I want to split an allocated memory region in two at a specific point, so that those two regions can be realloc
'd separately. I want to do this because I want to free space in the middle of the region.
My idea is to do something like this:
┌───────────────────────────────┐ │ Allocated │ └───────────────────────────────┘ ↓ split( ); ↓ ┌───────────────┬───────────────┐ │ Allocated │ Allocated │ └───────────────┴───────────────┘ ↓ realloc( ); ↓ ┌───────────┐ ┌───────────────┐ │ Allocated │ │ Allocated │ └───────────┘ └───────────────┘
Is this possible in Rust? If so, how?