This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Dynamic Memory Trickery
- To: gcc-help at gcc dot gnu dot org
- Subject: Dynamic Memory Trickery
- From: Justin Michael LaPre <laprej at rpi dot edu>
- Date: Tue, 23 Oct 2001 17:28:07 -0400 (EDT)
Hi all,
Recently I've implemented my own memory zone under Linux which
uses 4MB pages. I modified insmod and the related system calls to insert
modules into that memory zone. We're basically running an application
inside of this module. I can take out all file i/o, sockets, etc.
However, use of dynamic memory allocation is there to stay.
So what I want to do is use the compiler to manage my dynamic
memory instead of the kernel. I want to fool the application into
thinking it already has a lot of memory it can use (and basically, it
does, because it can use _all_ of the memory in my zone). malloc() will
not need to make any system calls if it has enough memory to fulfill a
memory request, correct?
So basically, I just need malloc to start allocating memory from
an address at or above something I specify, and for it to realize it
already has quite a lot of memory space to play with. Does anyone have
any ideas?
TIA,
-Justin