Open marmeladema opened 2 years ago
Hm... maybe we should make ScratchSpaceHeapAllocator
generic, like this:
pub struct ScratchSpaceHeapAllocator<T> where T: DerefMut[u8] {
scratch_space: T,
scratch_space_allocated: bool,
allocator: HeapAllocator,
}
For similar reasons as explained in https://github.com/capnproto/capnproto-rust/pull/243#discussion_r773027692, I need an owned version of
ScratchSpaceHeapAllocator
.Here is my proposal for a growing and owned segments allocator:
This is mostly a verbatim copy of
ScratchSpaceHeapAllocator
but which uses an internalVec<Word>
as first segment instead of a user provided mutable slice.I am sharing this to get some feedback and why not merge it upstream if deemed appropriate.