MSVCRT Heap?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I recently read that the heap that you access when you use malloc and free is
created by MSVCRT. Is the "default" or process heap ever used then if you're
not explicitly calling heapalloc with that heap? Why does MSVCRT not just use
this default process heap?
 
I recently read that the heap that you access when you use malloc and free is
created by MSVCRT. Is the "default" or process heap ever used then if you're
not explicitly calling heapalloc with that heap? Why does MSVCRT not just use
this default process heap?

1) So that the CRT can optimize memory management appropriately for C
programs.

2) So that the CRT can use VirtualAlloc to reserve address space
without committing it to the page file.

3) (Maybe) so that if the CRT heap is corrupted, the "non-C" parts of
the process (startup, shutdown, exception handling) have a usable
heap.

4) To make .obj modules compiled for use with different CRT DLLs or
static libraries incompatible regarding memory managmenet and create a
lot of activity on the vc newsgroups. :)
 
Thanks for the response, Severian...

-Ben

Severian said:
1) So that the CRT can optimize memory management appropriately for C
programs.

2) So that the CRT can use VirtualAlloc to reserve address space
without committing it to the page file.

3) (Maybe) so that if the CRT heap is corrupted, the "non-C" parts of
the process (startup, shutdown, exception handling) have a usable
heap.

4) To make .obj modules compiled for use with different CRT DLLs or
static libraries incompatible regarding memory managmenet and create a
lot of activity on the vc newsgroups. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top