Looking for a Lua alternative
Bastiaan Veelo
Bastiaan at Veelo.net
Fri Dec 15 10:53:44 UTC 2023
On Thursday, 14 December 2023 at 18:26:40 UTC, Siarhei Siamashka
wrote:
> On Thursday, 14 December 2023 at 18:18:21 UTC, matheus wrote:
>> Allocate();
>> GC.disable();
>> run_the_game();
>> GC.enable();
>
> Is the `run_the_game()` part of code supposed to be annotated
> with the `@nogc` attribute?
It depends, I guess. If it is not `@nogc` annotated, it can still
allocate and if it does it can run out of memory, unless it calls
`GC.collect` at the right moments. If it is `@nogc` annotated, it
cannot allocate and then the whole `GC.disable` and `GC.enable`
become unnecessary.
-- Bastiaan.
More information about the Digitalmars-d
mailing list