From 2beecc682a6ff09cd8df24cd8f1ff286c1ad15e1 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Wed, 26 Aug 2026 21:53:40 +0200 Subject: Update to last note. --- notes/260826-use-alloc.md | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'notes/260826-use-alloc.md') diff --git a/notes/260826-use-alloc.md b/notes/260826-use-alloc.md index 5797f98..394b69d 100644 --- a/notes/260826-use-alloc.md +++ b/notes/260826-use-alloc.md @@ -78,6 +78,7 @@ Maybe it's better to explain this with a table: | Slab | Block size | Max obj. size | Alignment | @@ -99,6 +100,15 @@ td:not(:first-child) { font-family: mono; } | 15 | 2048 K | 128 K | 64 | | 16 | 4096 K | 256 K | 64 | +The maximum "tail waste" for each block is equal to maximum object +size minus alignment. E.g. a 512-byte block can waste at most 24 +bytes due to the next 32-byte object not fitting. + +That waste calculation is not taking into account the waste from the +alignment padding, but that'll be relatively small as well if you do +the calculations, I'm pretty sure. In any case, no worse than other +general-purpose allocators, I'm pretty sure. + ## Occupancy bitmaps -- cgit v1.2.3