News for hackers. Stuff that matters.
Re:Fast, simple, hard real time allocator for Rust by scott_s on Thursday May 02, 2024 @09:55AM (#40236368)
> In a general purpose allocator, you can just store allocation metadata next to a payload so the lookup from a pointer address becomes O(1).

Yes, but the downside is that now allocator metadata pollutes the cache. It's super efficient for the allocator, but it may harm efficiency of the actual use of that memory. I believe most production allocators don't use object headers for this reason.

Re:Fast, simple, hard real time allocator for Rust by Someone on Thursday May 02, 2024 @10:57AM (#40237054)
> I believe most production allocators don't use object headers for this reason.

Isn’t the original reason hardening against buffer overflows? Overwriting allocator metadata can be used to attack a system.

Re:Fast, simple, hard real time allocator for Rust by pcwalton on Thursday May 02, 2024 @01:51PM (#40239204)
Yes. I believe that the standard workaround for this problem is to place the allocator metadata for an entire block at some fixed address boundary, so you can just mask off the bottom K bits of an address to find the allocator metadata for the block, and from there find the metadata of the allocation you're concerned with.