This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Pre-loading application memory
- From: llewelly at xmission dot com
- To: Robert Rose <rose at cafwap dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 30 Mar 2004 08:12:59 -0700
- Subject: Re: Pre-loading application memory
- References: <58DF2D6E-8229-11D8-9143-000393A47E62@cafwap.net>
Robert Rose <rose@cafwap.net> writes:
> Hi, I was wondering if anyone could provide some insight as to how I
> could pre-load my entire application's memory heap with predefined
> values, like 0xDEADBEEF for example. I'm interested in doing this on
> gcc-3.0 x86 and gcc-psion-2.9 (symbian).
[snip]
You might look into valgrind (http://valgrind.kde.org/) or efence.
The catch is these both only run on x86, and not on psion.
Alternatively, replace the system malloc and free with your own
hand-rolled malloc and free.
Finally, you may be able to simply allocate a block the size of your
entire heap at startup time, fill it with SNaN (or 0xDEADBEEF, or
whatever), and then free it.
The last is the simplest, so I'd try it first, and then, if your x86
source is the same as your psion source, try valgrind.