Re:On programming without malloc
by IgorPartola on Wednesday December 04, 2013 @05:44PM
(#6851005)
You probably want to align the memory you return as well instead of having size be an arbitrary value.
[ Parent
| on HN ]
You're right, it should word-align the addresses, but I didn't want to complicate things. This was just supposed to be a 'minimum viable allocator' to shove into a kernel temporarily then move onto other more interesting things.
What advantage does aligning it have, given that you are already satisfied with using an allocater that cannot free memory.
Re:On programming without malloc
by ArbitraryLimits on Wednesday December 04, 2013 @07:19PM
(#6851654)
None on Intel chips, but on virtual any other chip you'd get SIGBUS by referencing e.g. an N-bit datum not alinged on N/8-byte boundaries.