sos-os / alarm

ALARM: Another Library for Allocating and Releasing Memory
Apache License 2.0
8 stars 6 forks source link

Alloc architecture #17

Open hawkw opened 6 years ago

hawkw commented 6 years ago

I think we'll want to start with a frame/page allocator/provider (determine appropriate terminology) trait that allocates fixed-size (architecture dependent) pages, and implement the new buddy allocator and slabby on top of that. Not sure if ALARM should provide implementations of page allocators, but I think we should try to keep architecture specific code out of ALARM and in the hawkw/sos-kernel repo, especially since frame providers will probably need to know about e.g. the memory map.

hawkw commented 6 years ago

I think we'll want to have a "base" crate that provides traits like the frame provider (or whatever we end up calling it) trait, and then write the memory allocator implementations in their own crates that depend on the base crate. This seems like a better way to let consumers pick and choose allocator impls than A Big Mess Of Feature Flags like the old SOS allocator used.

We'll probably want to put the lifetime-based "allocation lender" stuff in the old SOS allocator in the "base" crate as well; I'd like to continue providing this API (and maybe actually use it this time around)...

hawkw commented 6 years ago

cc @croyzor, i figure you'll probably be interested in this