GNOME Bugzilla – Bug 313268
Introspection namespace->file mapping, use gmodule instead of dlopen, etc..
Last modified: 2015-02-07 16:50:09 UTC
Following up to [1], I have implemented the stuff I mentioned was missing. I realized eventually that there is no way we can make the namespace and file name be the same, therefore I added a new 'shared_library' string to the metadata file. It is optional, but it can point to the shared library that implementes the functions described in the metadata. Moreover, I created a GMetadata structure and replaced most occurrences of "guchar *metadata" with "GMetadata *". GMetadata holds the metadata, but can also hold a GMappedFile and, most importantly, a GModule. Since the GIBaseInfo was changed to keep a pointer to GMetadata, g_function_info_invoke now uses g_module_symbol to lookup the symbol from the correct library, whose symbols can therefore be loaded as private symbols, and lazily. And yes, I practically gave it away already, memory mapping metadata is implemented already. And so is a metadata searching. There's a "search path", with a default value $(libdir), plus the colon-separated directories listed in GIREPOPATH. Also the patch fixes some build/configure problems, makes the 'invoke' test actually exectute on make check, and adds a new test to check the new namespace->file mapping and automatic module loading. [1] http://mail.gnome.org/archives/gtk-devel-list/2005-August/msg00006.html
Created attachment 50595 [details] [review] the patch Here's the patch. Sorry; it's very difficult to break this stuff into several patches. :|
I will look at this once the 2.8 releases are out of the way
Erm.. anytime now would be great...
ping?
I committed a modified version of this to svn, it's already in used by pybank and seems to work quite well. Thanks!
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]