in reply to Dynaloader/XS: sharing C symbols across shared objects
There is another way to do it:
On the "server" module expose a perl function (or a global variable) that returns a pointer to a table containing pointers to all the functions that you want to share. Then on the "client" module, at boot, call the function returning the table pointer and save it into a static variable for later usage. For instance, Time::HiRes uses that approach.
It is more laborious but also guaranteed to work in any operative system while the dl_load_flags feature seems to be available only in some OSs.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Dynaloader/XS: sharing C symbols across shared objects
by creamygoodness (Curate) on Jun 10, 2008 at 19:26 UTC |
In Section
Seekers of Perl Wisdom