Future of memory management in D

Tejas notrealemail at gmail.com
Wed Nov 17 07:35:43 UTC 2021


On Wednesday, 17 November 2021 at 07:25:45 UTC, Stanislav Blinov 
wrote:
> On Wednesday, 17 November 2021 at 07:16:35 UTC, Imperatorn 
> wrote:
>> On Wednesday, 17 November 2021 at 07:08:45 UTC, Stanislav 
>> Blinov wrote:
>>> On Wednesday, 17 November 2021 at 02:32:21 UTC, H. S. Teoh 
>>> wrote:
>>>
>>>> [...]
>>>
>>> People write bugs. You don't say!
>>>
>>> [...]
>>
>> What do you mean by "you can't *actually* disable the GC"? 🤔
>
> I mean the GC.disable/GC.enable. The spec needs to be WAY more 
> strict and, well, specific, for those to be of use.

`GC.disable()` disables the running of a collection phase(and 
runs a collection __only__ when even the OS returns `Out of 
Memory` error), but allows allocation.
`@nogc` disables all allocations via the `GC`.

How else do you propose we further formalize these two notions? 
GC should throw Error if even the OS returns OoM rather than run 
collection cycle?


More information about the Digitalmars-d mailing list