A malloc function implemented through binary search tree.