#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::Crafting Interpreters::Ch 19 Strings
#columns:Front	Back	Tags
Crafting Interpreters ch 19, Strings: what does it cover?	Heap-allocated objects in clox, starting with strings: an Obj header, string objects, concatenation, and a linked list of all objects so they can be freed at exit.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::about
Crafting Interpreters ch 19, Strings: why does it matter?	This is where manual memory management starts in earnest. The object header plus linked list is the foundation for the garbage collector later.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::why
Crafting Interpreters ch 19, Strings: which part of the book is it in?	clox (bytecode VM, C)	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::part
Crafting Interpreters ch 19: what traps should you watch for?	<ul><li>Forgetting the null terminator or the +1 in allocations.</li><li>Leaking the intermediate string in concatenation.</li><li>Casting between Obj* and ObjString* incorrectly.</li></ul>	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::traps
Crafting Interpreters ch 19: which end-of-chapter challenges are worth your time?	Challenge 1 (flexible array members to store characters inline) is a classic C optimization worth doing. Challenge 2 (strings that do not own their characters) is a good follow-up.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::challenges
Crafting Interpreters ch 19, Strings: how should you work through it?	Run every test under AddressSanitizer and LeakSanitizer. Understand the struct inheritance trick (an Obj as the first field) before moving on.	cracked.guide cracked.guide::phase::interpreters cracked.guide::chapter::19 cracked.guide::kind::approach
