assert(false) and GC

Mathias LANG geod24 at gmail.com
Sat Jul 10 16:32:30 UTC 2021


On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote:
> On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer 
> wrote:
>>
>> I think it's the throwing/catching of the `Throwable` that is 
>> allocating. But I don't know from where the allocation happens.
>>
>> -Steve
>
> i think you are right

Try to use `@nogc` instead, it'll show you it does not allocate.
A caveat though: A failing assert used to allocate before 
v2.097.0 (the latest version), it does not anymore.

However, as your test captures all GC allocation, it likely 
triggers while the runtime is initializing.


More information about the Digitalmars-d-learn mailing list