Another idea to decrease the number of blocks to inspect when searching for a free block of sufficent size is to have separate lists for free blocks of different sizes.
Then instead of searching through all the free blocks, only search through a list of blocks that is known to be big enough.
For example, suppose we have 8 lists.
On the first list we might keep blocks of size 256 bytes.
The next list would have blocks of size 512 bytes, and the next list blocks of size 1024 bytes, and so on.
When a request is made we find the first list whose block size is big enough.
If the list is empty we have to try the next list and so on until we find a non-empty list.
However, we have avoided checking any of the blocks on the lists of smaller size that the request size.
Once a non-empty list is found in this search, we can allocate the entire first block on that list!
Disadvantage: This may lead to significant internal fragementation.