add Ritchie and Kernighan's malloc implementation
added text case