slow runtime

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Sep 10 19:40:10 PDT 2010


What about gc.disable() and gc.enable() ? If I'm sure that I won't
allocate anything within a section of code and I have to guarantee
realtime performance, then I could disable the gc temporarily.
Although this is not exactly what it states in the section on memory
management:

"Call std.gc.disable() before the smooth code is run, and
std.gc.enable() afterwards. This will cause the GC to favor allocating
more memory instead of running a collection pass."

Is the gc disabled after the call to gc.disable(), or just relaxed? If
it's not disabled, then I'm not sure why it's named like that.

On Sat, Sep 11, 2010 at 4:28 AM, Jonathan M Davis <jmdavisprog at gmail.com> wrote:
> snip


More information about the Digitalmars-d-learn mailing list