X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FMBlock.c;h=54d414807a1963005db95e4326f3226a62b57eef;hb=51a1bbab96f8795701fc59d295a5f556cfbf5622;hp=601387cf806da66730f40a3f0ee37734e113b971;hpb=73637ad66b7f88e57dcd0e0ea93b3d7bf8fb0d78;p=ghc-hetmet.git diff --git a/rts/sm/MBlock.c b/rts/sm/MBlock.c index 601387c..54d4148 100644 --- a/rts/sm/MBlock.c +++ b/rts/sm/MBlock.c @@ -348,8 +348,13 @@ allocNew(nat n) { if(rec->base==0) { stgFree((void*)rec); rec=0; - sysErrorBelch( - "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); + if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { + + errorBelch("out of memory"); + } else { + sysErrorBelch( + "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); + } } else { alloc_rec temp; temp.base=0; temp.size=0; temp.next=allocs;