DMD front-end can be used as a library with Dub

Rory McGuire via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 1 09:42:13 PDT 2016


Thanks, for the GC stub, that will be great for playing with whether or not
a little dmd app crashes after gc_annihilate(true).

Did I understand that right?

R


On Thu, Sep 1, 2016 at 6:16 PM, Cauterite via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Monday, 29 August 2016 at 10:42:23 UTC, Alexander Breckel wrote:
>
>>
>>
> Because of the poor memory management in the compiler, I included a
> modified GC-stub when I compiled the frontend as a library, so that it can
> be used in long-running processes:
>
> https://gist.github.com/Cauterite/4eb74347aea040f5d371fb49054e1819
>
> You can call gc_annihilate(true) to delete the entire heap.
>
> Obviously you need to keep the library in a separate DLL with its own
> runtime, and carefully avoid holding references to GC memory across
> annihilations.
>
> This technique is working pretty smoothly for me so far.
>
> Also to compile it as a DLL you either have to remove main() from mars.d
> or play games with the C runtime: https://gist.github.com/Cauter
> ite/b190e62891c773703d0de3a1d99df362
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160901/6d52cc9b/attachment.html>


More information about the Digitalmars-d mailing list