HashBlock FindFreeBlock(uint desiredSize)
{
HashBlock free = null;
foreach (HashBlock hb in mFreeBlocks)
{
if (hb.Count >= desiredSize)
{
free = hb;
break;
}
}
if (free == null && mFreeBlocks.Count > 0)
{
// Didnt find a large enough block, use the first block instead
free = mFreeBlocks[0];
}
return free;
}