Skip to content
All tags

#heap

2 posts

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

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.

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

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.