rust-osdev / linked-list-allocator

Apache License 2.0
219 stars 53 forks source link

Heap::extend_with_region() implementation #41

Closed MarcoCicognani closed 3 years ago

MarcoCicognani commented 3 years ago

Hi Phil,

phil-opp commented 3 years ago

Thanks for the pull request and sorry for the delay. While I understand your use case in #40, I don't think that modifying the Heap type is the best solution for this. My problem with it is that the API gets more complex and that the top and bottom methods might return None now. I would prefer to implement your second suggestion instead:

Otherwise you could make public the HoleList module to allow external uses.

This way, we keep the general API simple while still supporting users with more complex use cases. Would this work for you?

In case we implement this, I think we should move the align_layout function into the HoleList, so that the Heap type becomes just a trivial wrapper around HoleList.

MarcoCicognani commented 3 years ago

Hi Phil, don't worry for the late. Yes, I think that your solution is the best way to cover my needs