From af2d2cfdcdf5976f06fbcc4b1f8507f0b7d4af89 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 12:01:16 -0300 Subject: design: the visual system canim follows, with eight mock frames Lapis page and vellum ink; a role is a form as well as a colour (current, write, read, pointer, allocated, freed, fault, kernel); panels as acme windows; Go Mono for the machine and Go for the narrator; motion as whole frames at 60 fps. design/mock/gen.py redraws the mocks from the tokens. --- design/mock/04-malloc-glibc-musl.svg | 273 +++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 design/mock/04-malloc-glibc-musl.svg (limited to 'design/mock/04-malloc-glibc-musl.svg') diff --git a/design/mock/04-malloc-glibc-musl.svg b/design/mock/04-malloc-glibc-musl.svg new file mode 100644 index 0000000..a638d28 --- /dev/null +++ b/design/mock/04-malloc-glibc-musl.svg @@ -0,0 +1,273 @@ + + + +malloc: glibc and musl +heap.c:9 free(b); +kernel + +memory + +cpu + +source + + + + + + +glibc 2.39 +ptmalloc +the heap: one run of chunks + + + + +a + + + + + + +b + + + +c + + + + +tcache +unused + +32 bytes +inside b + + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +1 +size +of this chunk + +0 +0 +0 +0 +0 +0 +0 +5 +5 +d +4 +a +1 +c +0 +3 +next +free chunk: none + +8 +f +3 +a +6 +1 +c +2 +d +0 +7 +b +4 +e +1 +9 +key +marks it freed + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +a +your old data +0x20 + +1 free +0x30 + +0 +0x40 + +0 +0x50 + +0 +0x60 + +0 +0x70 + +0 + + +its notes: a list for each size, kept in the heap itself + + + + +musl 1.2.5 +mallocng +the heap: groups of equal slots + + + +c + + + + +112-byte slots + + + +a + + + + +b + + + + + + +32-byte slots +inside b + + + +f +f +0 +0 +0 +0 +0 +0 +its tag, cleared + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +2 +a +your old data, + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +all of it untouched +can hand out + +0 + +0 + +1 + +1 + +1 + +1 + +1 + +1 + +1 + +1 +freed + +0 + +1 + +0 + +0 + +0 + +0 + +0 + +0 + +0 + +0 +a +b +one bit for each slot +its notes: one record for each group, kept apart +glibc threads its free list through the freed chunk itself. +musl flips one bit in a record it keeps apart from your data. + -- cgit v1.3