[Mono-devel-list] Call functions defined modules for libmetadata.so from libmonogc.so?
Paolo Molaro
lupus at ximian.com
Fri Nov 26 09:46:19 EST 2004
On 11/24/04 Okehee Goh wrote:
> Currently, MONO runtime libraries including libmonoruntime.la,
> libmetadata.la etc. calls functions defined in libmonogc.so. I wonder
> whether it's allowed to call functions defined modules for
> libmetadata.so from libmonogc.so.
> But i need to have functions in libmonogc.so call functions in
> libmetadata.la etc. Right now, I got "undefined.." error while trying
> that.
[...]
> Anyway, my question is whether it's allowed to call functions defined
> modules for libmetadata.so from libmonogc.so?
It's not possible. I suggest you use a callback interface:
have a function in libmonogc.so that can be used to register a callback
and when the GC is initialized (from the metadata/ code) it calls
the function to register a callback.
See for example in metadata/gc.c in the function mono_gc_init()
how GC_finalizer_notifier, GC_oom_fn etc are set (they just
set a static function pointer, using a function to register
the callback would be cleaner).
lupus
--
-----------------------------------------------------------------
lupus at debian.org debian/rules
lupus at ximian.com Monkeys do it better
More information about the Mono-devel-list
mailing list