Export GC memory manager to C???

Timon Gehr timon.gehr at gmx.ch
Thu Jul 28 11:47:52 PDT 2011


Robert Persson wrote:
> Would it be possible to export GC.malloc(...) as a C function in a DLL, to
> use as a garbage collected memory allocator for C ? Or does the garbage
> collector not scan outside the boundaries of the DLL?

The DLL contains code which is dynamically loaded into your program's address
space, so the boundaries indicated by you should not exist.
I cannot think of a reason why you shouldn't be able to directly expose the
GC-interface to C. (As D provides full C-interoperability)

Just out of curiosity, what is your use case?

-Timon


More information about the Digitalmars-d mailing list