Can't you just build your own memory space using a standard Win API? Like allocate and deallocate? You didn't specify which OS, but I know that is the easiest way to do it in VB, and most of those API's carry over to C++ and C#. You could get into trying to code your own algorithms to stack int's together to get the right variable size, but why recreate the wheel? There is plenty of great code out there to already do it. For unix you might need to snag an efficient module off of the web.

Just google for memory management API, or memory management C++ 4096bytes. Something like that should return an answer for you.