|Producing memory traces of C storage allocation? email@example.com (2001-06-28)|
|Re: Producing memory traces of C storage allocation? firstname.lastname@example.org (Joachim Durchholz) (2001-07-02)|
|Re: Producing memory traces of C storage allocation? email@example.com (Graeme Roy) (2001-07-02)|
|Re: Producing memory traces of C storage allocation? firstname.lastname@example.org (2001-07-02)|
|Re: Producing memory traces of C storage allocation? email@example.com (Friedrich Dominicus) (2001-07-17)|
|From:||firstname.lastname@example.org (George Neuner)|
|Date:||2 Jul 2001 00:32:53 -0400|
|Organization:||Automated Visual Inspection Systems, Inc.|
|Posted-Date:||02 Jul 2001 00:32:53 EDT|
On 28 Jun 2001 23:45:11 -0400, email@example.com (Corndog) wrote:
>Does anyone see what I'm getting at?
>I figure the only way I can get the actual size of the heap at any
>given point in time is to have the compiler intercept the memory
>allocation routines and do the work of wrappers
>for me. Please help..puhlease! I'm working on Windows by the way.
Do you really need to intercept allocation calls interactively or can
you make do with periodic heap dumps?
You didn't say what compiler you are using. On Win32, both VC++ and
Borland vector (m|c)alloc and new through HeapAlloc on the global
I'm not aware of a way to front hook the allocator (you can hook the
back end exception handler but that won't help you here). However, if
a dump of the heap will suffice, you can obtain it using the HeapWalk
function in the Win32 API or _heapwalk in the C runtime library. In
general you should become familiar with the Heap* functions for
serious programming in Win32.
If you are using a Win32 version of GCC, you're on your own because I
know nothing about the runtime support for them. I would suggest you
get the source to the standard library, modify the allocator as you
need and build a custom library to use.
>(I have never done any work on compilers before and I have limited
>knowledge of C, but I can touch my nose with my tongue! Duh..huh huh)
I hope you can swim because the water is blue and there be sharks ;)
Return to the
Search the comp.compilers archives again.