Memory registration model

Hello,

Did anyone ever create some sort of memory registration model ?
For example :
The model would be asked to allocate a given size ‘sz’ of memory between address ‘st’ and ‘ed’ and would return the start_address and an id/key.
Unless the model is asked to deallocate this given memory associated with id/key, it must not reallocate it.

Thanks
Rohit

In reply to new():

This can be quite a complex topic. There are many different strategies for handling this depending on expected use cases and performance goals. See heap allocation in Stack vs Heap Memory Allocation - GeeksforGeeks

In reply to dave_59:
Thanks Dave !
Will using malloc()/free() via C DPI help?

In reply to new():
You need to provide more detail. malloc()/free() does what you want for the memory used by a C program. But if you’re looking to allocate memory used by a simulated memory model, you may want to look at something like this.