nice

:)



in order to add magic to APR::Pool->new() based objects, I had to pull a few tricks. to avoid messing with the existing typemaps (which wouldn't work anyway) and the majority of the autogeneration code, what I ended up doing was adding an additional parameter to apr_functions.map. the additional parameter, if present, represents a function to place in a CLEANUP section in WrapXS. this allows the current autogenerated code to keep on working, while allowing me to manipulate the object just before it is returned to perl-space.


OK, if setting magic requires tricks, why not use apr_pool_userdata_set in mpxs_apr_pool_create for destroy-able objects?

hmph. but implementing the magic was so much fun :)


apr_pool_userdata_set is probably a better way, although I have to see if it will actually work tomorrow - I was seeing problems with subpools where is_ancestor and get_parent were _not_ working as expected with subpools, so I have concerns as to whether the data will persist. but testing will decide :)


anyway, attached is the patch in full. as I said, it's only a first pass, but it seems to work and is relatively clean. adding the ability to set CLEANUP sections may be geniuinely useful if we need to do stuff like this in the future, so I thought it was as good an approach as any.


If this goes in, we probably need to sync with Gerald, since the plan was to have ExtUtils::WrapXS to replace the current internal implementation when the external one is completed.

ok. if we go the apr_pool_userdata_set avenue, then I'm not going to worry about the autogeneration stuff. that is, unless you think it will be nice to have just in case.


--Geoff


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to