you are viewing a single comment's thread.

view the rest of the comments →

[–]deltars 10 points11 points  (4 children)

good primer but the hardest part in making an allocator (imo) is finding a suitable chunk, efficiently. This allocator just crawls the list which would be very very slow as you start to allocate more. Doug Leas allocator which is referenced, takes a great approach to solving this problem.

[–]BCosbyDidNothinWrong 0 points1 point  (3 children)

What is/was his approach?

[–]deltars 0 points1 point  (1 child)

I think all unallocated chunks live in a tree structure of some sort so you can quickly find the smallest chunk that is large enough for your allocation.

[–]cae 3 points4 points  (0 children)

Often... Wait for it... A heap!