Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory Management

55 views
Skip to first unread message

Kevin Pyc

unread,
Apr 11, 2012, 1:11:29 AM4/11/12
to
Is the remaining part of the heap (from the current pointer to the end
pointer) considered a hole even though it is not part of the asl? When
exactly do you check the remaining part of the heap? Before or after
the asl?

As an example, using worst fit, if there are three holes of size 20,
30 and 40, and 60 words left on the heap, a new allocation of size 20
would go in a) the 3rd free hole (the hole of size 40) or b) the
remaining area of the heap (size 60)

Stephen Pisani

unread,
Apr 11, 2012, 1:30:31 PM4/11/12
to
For fixed-sized allocation you don't need any algorithm to determine
where to allocate memory from, since you just grab the first available
slice in O(1) time. Thus you aren't concerned about holes since in the
end if the entire arena needs to be allocated then it will. In class if
there were blocks of memory in the ASL we used those first, and failing
that we used the current pointer.

For variable-sized allocation, there is no current pointer, just the
ASL, so the ambiguity in your scenario disappears.

Omar Sherwani

unread,
Apr 11, 2012, 1:31:01 PM4/11/12
to
Does anyone have online notes for memory management that they could
send me? I missed this being done and have been trying to find
material online to learn this but have been unsuccessful.
Heres my email if anyone would be kind enough to send me the notes:
omarsh...@gmail.com

What is the solution to part 8 in the final review?
0 new messages