GC works with malloc() works, but throws out of memory with HeapAlloc(). Why?

%u wfunction at hotmail.com
Tue Jan 4 02:55:49 PST 2011


> Sorry, do you mean the libc functions? The GC doesn't use those to
> allocate its memory pools, and uses page allocation functions (mmap on
> *nix and VirtualAlloc on Windows). If you mean the GC functions, then
> wouldn't your hooked malloc be called before mallocNoSync is called?

I actually found the error (after > 8 hours of searching); it was because
HeapReAlloc wasn't calling HeapAlloc if the passed pointer was null, the way
realloc() is supposed to. Thank you for your reply though!


More information about the Digitalmars-d mailing list