diff options
Diffstat (limited to 'notes/260826-use-alloc.md')
| -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 |
