rust-osdev/linked-list-allocator

Release extended memory

开放

#57 创建于 2022年4月3日

 (1 条评论) (0 个反应) (0 位负责人)Rust (56 个派生)github user discovery
help wanted

仓库指标

星标
 (241 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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 :^).

贡献者指南