diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-08-26 21:53:40 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-08-26 21:53:40 +0200 |
| commit | 2beecc682a6ff09cd8df24cd8f1ff286c1ad15e1 (patch) | |
| tree | 1024e0c69778a9ac10533ea82805640526daa823 | |
| parent | b616e17f81b7bbe5b97feb5bb1bb3911ea0dfcf7 (diff) | |
Update to last note.
| -rw-r--r-- | notes/260826-use-alloc.md | 10 |
1 files changed, 10 insertions, 0 deletions
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: <style> td:first-child { font-weight: bold; } td:not(:first-child) { font-family: mono; } +td { text-align: right; } </style> | 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 |
