Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You probably want to align the memory you return as well instead of having size be an arbitrary value.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: