linked-list-allocator
linked-list-allocator copied to clipboard
Release extended memory
Add a way to release extended memory since it might be the case where one allocates a large amount of memory temporarily and then never needs the allocate such large amount of memory and releasing memory is a must in this situation. So, it would be reasonable to have a function such as release_memory
which takes in a closure that internally the allocater calls if a hole is available at the end of the heap and the actual memory can be freed.
Other ways?
Another way to accomplish this without changes to the allocator to itself (but will be pain) is to make the caller free the memory itself and allocate a block of memory at that location on a page fault (on the next allocation if required). Like kernel-heap-on-demand-paging and inefficient :^).
Sounds like a reasonable feature, I'm happy to merge a PR for this.