What to do with InvalidMemoryOperationError

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 23 13:25:00 PST 2015


On Friday, 23 January 2015 at 10:13:43 UTC, Joakim wrote:
> InvalidMemoryOperationError generally means that you are 
> performing certain disallowed memory operations during a full 
> garbage collection, such as allocating while the gc is running.

If my app is single-threaded this cannot happen then.

>  This usually happens when you call a function that allocates 
> in a destructor, which will trigger this error as the 
> destructor is run by the gc.
>
> It appears that the gc issues mentioned above can also trigger 
> it.  If you're running off git head, maybe you can apply that 
> PR 2794 and see if it helps.  Otherwise, maybe you've hit some 
> other gc issue somewhere.

So if GC.disable prevents the error from occurring I will have a 
clue, right?


More information about the Digitalmars-d-learn mailing list