On 24-Jun-12 08:15, Ellery Newcomer wrote:
this code:

class X{
     string[string] s;
     this() {
         s["s"] = "S";
     }
     ~this() {
         s.remove("s");

     }
}

void main() {
     X x = new X();
}

produces this:

core.exception.InvalidMemoryOperationError

because the aa is calling gc_free during a collection, apparently.

Should I be expecting the above code to run without error or not?

thanks

I think no, as any with operation involving GC. For instance while you are removing elements table may decide to rehash itself and that means it may trigger allocation.

--
Dmitry Olshansky


Reply via email to