Doug Lea's dlmalloc implementation is the basis for GCC's ptmalloc, IIRC. His writeup on the topic is a wonderful read; and for the code itself, it is beautifully organised and well commented.
The NetBSD is also a great starting point for people who want to port to weird architectures. It's simple and a little old fashioned, but it's in the sweet spot for most bootstrappable C compilers for memory-constrained devices. This or dmalloc are usually the easiest to get up and running on a device where you can't or don't want to trust the system libraries.
http://g.oswego.edu/dl/html/malloc.html