Skip to content
Love Ottosson edited this page Sep 10, 2015 · 5 revisions

Malloc will behave differently depending on which strategy is used when running the function. We will divide it into an original implementation and a quick fit implementation. Both implementations will show, in a pseudo kind of way, which functions and operations that executes when malloc is called.

###Original implementation This implementation will be used when strategy is set to either of 1, 2, and 3, which corresponds to first fit, best fit and worst fit.

Note that the step find large enough memory node in 'free list' will call either first_malloc, best_malloc or worst_malloc depending on strategy.

###Quick fit implementation This implementation will be used when strategy is set to 4, which corresponds to quick fit.

Clone this wiki locally