Building several dynamic libraries with one shared GC
NonNull
non-null at use.startmail.com
Sun Sep 12 14:31:04 UTC 2021
I am making a plug-in development system for a high performance
Linux application that already exists and is written in C and
will not be modified for this purpose. It is already has an API
for plugins written in C. A plug-in simply makes new functions
(e.g. manipulating text and numbers) available to be used inside
the application. The D GC will intentionally be available inside
a plugin.
I have written a D source file containing templates that do the
work when a plugin is written by a third party in D. A plugin
will expose a C API for the functions made available to the
application, and any data in D made available to the application
will be copied to the application's managed storage and vice
versa, so there are no GC issues.
All of this is to make it as simple as possible for a third party
to write such a plugin without worrying about any of these
issues, and use D in a simplistic scripting language-like way.
This is for non-experts. They just use the templates and build a
dynamic library and all of the above is done for them.
If several plugins are built by different third parties, each
dynamic library will have its own GC and copy of druntime right
now. How can I organize that there is one separate dynamic
library to share these among all plugins?
More information about the Digitalmars-d-learn
mailing list