Hi there, On December 2, 2003 06:29 pm, Verdon Walker wrote: > Should OpenSSL formalize a mechanism for cleaning up global library > resources? Or is it sufficient to let the OS do that work?
I've got way too much on my plate right now to do anything more than make a passing comment, but that will hopefully be better than nothing. This cleanup stuff came up a while ago in a couple of different guises, but most pertinent to me was when reworking the engine internals for 0.9.7. Right now that uses a cleanup mechanism (localised to the engine code) whereby anything that would need cleanup registers itself, using a callback fn pointer + void* object pointer, so that its cleanup will be invoked all from the single cleanup API. This is how the various implementation registries pop up "on demand" and then get cleaned up during shutdown. At the time, I raised the subject of generalising this for the whole library as it solves the collective cleanup problem without falling into the main trap we need to avoid - namely creating static linker dependencies from the "OPENSSL_cleanup()" function to everything in the library that could possibly be cleaned up. Ie. if you call EVP_FOO_create_some_crud(), then a pointer to EVP_FOO_cleanup() plus a pointer to global state can be pushed onto the cleanup stack - without the cleanup code itself having any link-time dependency on anything in EVP (if your app links to EVP_FOO_create_some_crud(), then *that* is what would cause the linker to bring in that code and the corresponding cleanup callback). But it never went any further than that, ie. a discussion. Please feel free to open an RT ticket about this and assign ownership to me if you like so that it doesn't slip through the cracks - but I guarantee that I won't even think about it until I'm done with this bignum stuff. You may be able to find the discussion threads in the archives somewhere (unless I was silly enough to have raised this only on openssl-team - hmm - let me know if you can't find anything and I'll dig). Cheers, Geoff -- Geoff Thorpe [EMAIL PROTECTED] http://www.geoffthorpe.net/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]