diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-09-22 06:21:48 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-09-22 06:21:48 +0200 |
| commit | 685a7b3456185c39e7813c3c69ab0b346daf9e1f (patch) | |
| tree | 10fad0b4db1a32f28a56cdcd2e875831029b9730 | |
| parent | 3c10f51f21c525cb5c28efd7a99fc9e0b3baf96b (diff) | |
Amend latest note.
| -rw-r--r-- | notes/260922-use-alloc-3.md | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/notes/260922-use-alloc-3.md b/notes/260922-use-alloc-3.md index 9ca98f7..abe520d 100644 --- a/notes/260922-use-alloc-3.md +++ b/notes/260922-use-alloc-3.md @@ -65,13 +65,17 @@ Block Alloc, with the following collection strategy: phase (bit was set in original) but have been found not to be live anymore (bit not set in new). -* If an entire block comes out empty, we can release it directly back - to Meta Alloc. Otherwise, we perform a `free()` on individual "now - dead" memory slots which does something similar to Block Alloc, but - freeing directly to the shared free-list of the appropriate size - class, instead of thread-local caches. The mutator threads have - thread-local caches anyway, filled from the global free-list in - chunks, as an optimization. +* If a block was completely full, but is now completely empty, we can + free it back to Meta Alloc. (If only some slots were occupied and + now the whole block is empty, we can't free it, since some of its + unoccupied slots may be in a free-list.) + +* Otherwise, we `free()` individual "now dead" memory slots in it, + which works similarly to the `free()` of Block Alloc, but putting + the slots directly into the shared free-list of the size class, in + chunks to decrease contention. (Mutator threads have thread-local + caches anyway, filled from the global free-list in chunks, as an + optimization.) * We need a way to identify what size class a block is for. Remember that the blocks supporting multiple size classes use a `u32` but |
