473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

MSVCRT 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?
Nov 17 '05 #1
2 1725
On Thu, 31 Mar 2005 13:23:02 -0800, Ben R.
<Be**@discussions.microsoft.com> wrote:
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. :)

--
Sev
Nov 17 '05 #2
Thanks for the response, Severian...

-Ben

"Severian" wrote:
On Thu, 31 Mar 2005 13:23:02 -0800, Ben R.
<Be**@discussions.microsoft.com> wrote:
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. :)

--
Sev

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dbrown2 | last post by:
I'm having some trouble using kbhit inside the editor enviroments. I'm using win2000 with Python2.3 and win32all v157 versions. Any pointer on how this should be handled would be appreciated. Is...
0
by: Ron Adam | last post by:
Yes, another newbie question. :-) When I run the following from idle, the msvcrt.getch() function always returns 255 and it doesn't wait for a key press. It also displays the key on the screen...
4
by: Baga | last post by:
Our product is compiled with /MD switch, so it uses MSVCRT.DLL But as every system configuration that we support includes this file anyway, we do not actually redistribute it, instead we use the...
1
by: Chris | last post by:
Hi I know it's not a good idea to use both msvcrt.lib and msvcrtd.lib in your project, and the same goes for msvcprt.lib and msvcprtd.lib. But is it ok to use both msvcrt.lib and msvcprt.lib? Or...
1
by: Michael | last post by:
Hi! I've developed a simple game that needs to be compiled as a multithreaded dll. I've read that since I use this runtime-library my applications will need MSVCRT.DLL at runtime. Is it possible...
0
by: bluter | last post by:
I have a problem with some VC++ (v5 sp3 compiled in debug mode) server component which perfrom Data Acces. These have been in production on NT4.0 and w2k. However when we try to use them on Server...
7
by: sturlamolden | last post by:
This question has been asked many times, and last time I was accused of spreading FUD. So now I will rather propose a solution. The reason for the problem is as follows: The binary installer...
18
by: =?Utf-8?B?RGF2aWQ=?= | last post by:
I have a VC++ / .NET 2.0 solution built using VS 2005 SP1 under XP. Everything has been working well there over the past year. I have recently starting porting the app to Windows Vista (since it...
11
by: Dick Moores | last post by:
Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way to catch the pressing of the 'Enter' key?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.