2

There doesn't seem to be that many good descriptions that go into the specifics about how dlmalloc works. The sources I have come across so far mention dlmalloc, but then only goes on to explain what malloc() and free() are, rather than describing dlmalloc.

The Wikipedia description, on the other hand, was a bit hard for me to understand. http://en.wikipedia.org/wiki/Malloc#dlmalloc_and_its_derivatives

Can anyone explain the workings of dlmalloc, how to implement it, and any additional sources that could help?

Dark Templar
  • 6,323

1 Answers1

2

If you ever don't understand an implementation you should check the source, if available. Here's a fairly extensive explanation which was mentioned in the source.

Can anyone explain the workings of dlmalloc, how to implement it, and any additional sources that could help?

If you want to use dlmalloc then download the source. Creating your own version of malloc is going to be very difficult and will take you days reading to understand dlmalloc's source.

If you want to learn how dynamic memory works then I suggest you create a memory pool/allocator which will teach you everything you need to know. All you need to do is allocate a large buffer and create functions which allocate/free parts of that buffer.

Pubby
  • 3,390