3 ms·
I think it would be pretty reasonable to have an input type for that parameter that isn't a full usize and is instead some more restricted type that can only re
by loeg 3y ago
I think it would be pretty reasonable to have an input type for that parameter that isn't a full usize and is instead some more restricted type that can only represent smaller values. The alignment parameter could be, like, u8, or maybe u16.
- dev_dwarf 3y agoFor the alignment parameter I agree.
- loeg 3y agoFor both.
- sltkr 3y agoThis still doesn't solve the overflow problem. It's also too limiting: with u8 you can't ask for page-aligned data, and with u16 not for hugepage-aligned data. Granted, those aren't exactly prime use cases for a bump allocator, but it seems like poor design to limit the API unnecessarily.
- loeg 3y agoIt fully solves the overflow problem. You don't need page-aligned data in a bump allocator.