On Wed, 2012-06-27 at 18:04 +0200, Michal Srb wrote: > Calling dlsym with handle of the module library > instead of RTLD_DEFAULT prevents increasing reference > counter of the library and so allows it to be > really unloaded if UnloadModule is called on it > later.
That's not how I would have expected libdl to behave. I wouldn't have thought dlsym success would increase the refcount of the providing object, given that there's no way in the API to release that reference; if dlsym _does_ bump the refcount I'd have thought the resolution scope would not be a factor. I'd be interested to know when and why this behaviour was added. A quick read of freebsd's dlsym doesn't appear to have that behaviour to me, but then neither does a quick read of glibc's dlsym. But I'm always a fan of turning O(n) into O(1). Reviewed-by: Adam Jackson <[email protected]> - ajax
signature.asc
Description: This is a digitally signed message part
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
