[Issue 17326] 2.072 gc changes broke 32 bit Windows DLLs

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 14 23:45:00 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17326

Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario at gmx.de

--- Comment #2 from Rainer Schuetze <r.sagitario at gmx.de> ---
DLLs with clear separation of ownership work fine (e.g. Visual D is a DLL).

As said repeatedly, the GC proxy mechanism is no good but for very simple use
cases. Threads need to be shared, too, so the GC can stop and analyze them.
Anything happening in a destructor needs to be executed against the correct
runtime library, including the C runtime.

Despite that, the proxy mechanism is still there, you can use it as shown in
https://wiki.dlang.org/Win32_DLLs_in_D#D_code_calling_D_code_in_DLLs: export
gc_setProxy by the DLL and use Runtime.loadLibrary instead of LoadLibraryA to
load it.

It's unfortunate that gcstub/gc.d has not been updated (or better removed). You
can now select something similar by embedding 

  extern(C) __gshared string[] rt_options = [ "gcopt=gc:manual" ]

into the binary. See http://dlang.org/spec/garbage.html#gc_config

--


More information about the Digitalmars-d-bugs mailing list