Skip to content
All tags

#heap

2 posts

Stanford CS107 Lecture 21: A First Heap Allocator and the Tension Between Speed and Space

CS107 Lecture 21 starts with alignment, throughput, and utilization, then uses a bump allocator and an implicit free list to explain metadata, splitting, placement, internal and external fragmentation, and the need to coalesce freed blocks.

Stanford CS107 Lecture 10: Stack vs. Heap Is About Lifetime and Ownership, Not Just Speed

CS107 Lecture 10 moves from sizeof and pointer arithmetic to stack-frame lifetime: returning a local array leaves a dangling pointer; malloc crosses function returns but makes NULL handling, size arithmetic, ownership, free, and leaks the programmer's responsibility.