private void Deallocate(void *pointer)
 {
     MemoryHeap.Free(pointer);
     m_totalBuffers--;
     m_totalMemory -= m_settings.BufferSize;
     GC.RemoveMemoryPressure(m_settings.BufferSize);
 }
 protected override void Dispose(bool disposing)
 {
     while (m_buffers.Count > 0)
     {
         void *ptr = m_buffers.Pop();
         if (ptr != null)
         {
             MemoryHeap.Free(ptr);
         }
     }
     GC.RemoveMemoryPressure(m_totalMemory);
 }
        private void Allocate(int bufferSize, int numOfBuffers)
        {
            for (int i = 0; i < numOfBuffers; i++)
            {
                void *buffer = MemoryHeap.Alloc(bufferSize);
                m_buffers.Push(buffer);
            }

            int allocatedBytes = bufferSize * numOfBuffers;

            m_totalMemory  += allocatedBytes;
            m_totalBuffers += numOfBuffers;
            GC.AddMemoryPressure(allocatedBytes);
        }