Control heap allocation into a certain memory range?


#1

The motivation is to keep all the objects heap allocated in a certain range so that I can dump that part of memory which contains all the objects.

Is there possible to control heap allocation, say all the heap allocated objects are between 0x400000 to 0x500000?Or Is it possible to use customised allocator (so that i can control it)?

Thanks.


#2

Custom allocators are a nightly-only feature: https://doc.rust-lang.org/stable/book/custom-allocators.html

I’m not aware of how to do it otherwise, maybe someone else does.