[dub] Passing --DRT-gcopt to dmd
Andre Pany
andre at s-e-a-p.de
Fri May 31 13:50:57 UTC 2019
On Friday, 31 May 2019 at 13:37:05 UTC, Anonymouse wrote:
> On Friday, 31 May 2019 at 10:47:20 UTC, Mike Parker wrote:
>> On Friday, 31 May 2019 at 10:27:44 UTC, Anonymouse wrote:
>>
>>> What is the correct way?
>>
>> --DRT flags are for run time, not compile time. They're
>> intended to be passed to your executable and not the compiler.
>> From the docs [1]:
>>
>> "By default, GC options can only be passed on the command line
>> of the program to run"
>
> My use-case is limiting the amount of memory dmd will allocate
> before -lowmem kicks in and collects (by use of
> --DRT-gcopt=heapSizeFactor on dmd), to accomodate for limited
> available memory. As pasted in the original post I seem to be
> able to do this manually.
>
> So there is no way to set up a dub build configuration that
> automates this?
You can specify the parameters also in code. See example here
https://dlang.org/changelog/2.085.0.html#gc_cleanup
Kind regards
Andre
More information about the Digitalmars-d-learn
mailing list