Lucene.Net.Index.DocumentsWriter.BytesAllocated C# (CSharp) Method

BytesAllocated() private method

private BytesAllocated ( long numBytes ) : void
numBytes long
return void
		internal void  BytesAllocated(long numBytes)
		{
			lock (this)
			{
				numBytesAlloc += numBytes;
			}
		}
		

Usage Example

Beispiel #1
0
        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);
            }
        }
All Usage Examples Of Lucene.Net.Index.DocumentsWriter::BytesAllocated