Change the search for free space from one based on segments to one based on free list sets, so that the same free list sets are not examined more than once, and so that confusion that might arise when a search for a range in one segment produces a range in another segment might be eliminated.
In the case where more than one free list element is examined, allow less than max-sized free blocks to complete the allocation, if possible.