
106 ◾ Software Essentials
compiler determines the size of stack frames. At runtime then, there is
no overhead for computing the location of allocated memory. Dedicated
hardware, such as the stack register, supports fast updates to stack mem-
ory references. In contrast, heap memory is controlled through the alloca-
tor (and deallocator), incurring runtime overhead.
4.3.1 Allocation
Ecient memory allocation is not a trivial endeavor. Standard approaches
include rst-t and best-t. First-t allocates the rst block found on the
free list that is large enough to satisfy the memory request; best-t nds
the smallest block that satises the ...