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/02-list-insert.svg | 286 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 286 insertions(+) create mode 100644 design/mock/02-list-insert.svg (limited to 'design/mock/02-list-insert.svg') diff --git a/design/mock/02-list-insert.svg b/design/mock/02-list-insert.svg new file mode 100644 index 0000000..878740d --- /dev/null +++ b/design/mock/02-list-insert.svg @@ -0,0 +1,286 @@ + + + +Linked lists +insert after a node +kernel + +memory + +cpu + +source + + + + + + +list.c +3 +struct +node { +4 +long +value; +5 +struct +node *next; +6 +}; + + + +21 +n = malloc( +sizeof +*n); + +22 +n->value = v; + +23 +n->next = at->next; + + +24 +at->next = n; +25 +return +n; + +locals + +at +0 +0 +0 +0 +5 +5 +d +4 +a +1 +c +0 +3 +2 +a +0 +node 7 + +n +0 +0 +0 +0 +5 +5 +d +4 +a +1 +c +0 +3 +2 +e +0 +node 9 +v +9 + + + + +the list +what the code means + +head + + + +7 + + + +12 + + + +9 + + + + + + + + +at +n +the end + + + + +heap +eight bytes a row, as one number ยท low addresses on top + + + +malloc's own 16 bytes +55d4 +a1c0 +32a0 + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +7 +value += 7 + +at + +55d4 +a1c0 +32a8 + +0 +0 +0 +0 +5 +5 +d +4 +a +1 +c +0 +3 +2 +e +0 +next + + + +55d4 +a1c0 +32c0 + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +c +value += 12 +55d4 +a1c0 +32c8 + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +next += NULL + + + +55d4 +a1c0 +32e0 + +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +9 +value += 9 + +n + +55d4 +a1c0 +32e8 + + +0 +0 +0 +0 +5 +5 +d +4 +a +1 +c +0 +3 +2 +c +0 +next + + + + + + + +Inserting moves nothing. One word changes: the next field of at +now holds the address of the new node. + -- cgit v1.3