add Ritchie and Kernighan's malloc implementation

code is mostly taken from the book:
"The C Programming Language, 2nd Edition by Ritchie and Kernighan"

Unfortunately there was no license given...