@eniko On the GameBoy Advance, we had 2 chunks of RAM at different fixed addresses (32k and 256k). For us the logical thing was to hardcore the local variable base pointer and the stack pointer the each end of the 32k region, and make the base pointer for malloc/free use the start of the 256k region.
In your case, you could probably hardcore your base pointers similarly. Decide memory_base is where variables go, memory_base+256k-1 is where your stack pointer goes, and malloc/free starts at memory_base+256k.
In essence, let the compiler do the work, and you live with some hard coded limits