public override bool FreeRAM()
{
lock (this)
{
if (!trackAllocations)
{
return(false);
}
bool any;
int numToFree;
if (postingsFreeCount >= postingsFreeChunk)
{
numToFree = postingsFreeChunk;
}
else
{
numToFree = postingsFreeCount;
}
any = numToFree > 0;
if (any)
{
for (int i = postingsFreeCount - numToFree; i < postingsFreeCount; i++)
{
postingsFreeList[i] = null;
}
postingsFreeCount -= numToFree;
postingsAllocCount -= numToFree;
docWriter.BytesAllocated((-numToFree) * bytesPerPosting);
any = true;
}
if (nextTermsHash != null)
{
any |= nextTermsHash.FreeRAM();
}
return(any);
}
}