[Issue 15484] core.memory.GC.disable() is not @nogc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 21 09:31:15 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=15484

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |schveiguy at yahoo.com
         Resolution|WONTFIX                     |---
           Severity|normal                      |enhancement

--- Comment #4 from Steven Schveighoffer <schveiguy at yahoo.com> ---
@nogc means no allocations, no more no less. See Walter here:
https://forum.dlang.org/post/ogal82$2ubk$1@digitalmars.com

I can see a use case for this, but not with the OP's code, since it has
allocations (and obviously those aren't @nogc).

But if you were in, let's say a critical part of a rendering loop, and did not
want to drop frames, you may disable the gc to prevent *other threads* from
collecting during this critical period, and then turn it back on.

So I think the enhancement request is legitimate.

--


More information about the Digitalmars-d-bugs mailing list