This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pre-loading application memory


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]