コード例 #1
0
ファイル: GrabAllocator.cs プロジェクト: Neo4Net/Neo4Net
 /// <summary>
 /// Create a new GrabAllocator that will allocate the given amount of memory, to pointers that are aligned to the
 /// given alignment size. </summary>
 /// <param name="expectedMaxMemory"> The maximum amount of memory that this memory manager is expected to allocate. The
 /// actual amount of memory used can end up greater than this value, if some of it gets wasted on alignment padding. </param>
 /// <param name="memoryTracker"> memory usage tracker </param>
 internal GrabAllocator(long expectedMaxMemory, MemoryAllocationTracker memoryTracker)
 {
     this._grabs = new Grabs(expectedMaxMemory, memoryTracker);
     try
     {
         CleanerHandles handles = FindCleanerHandles();
         this._cleaner     = handles.Creator.invoke(this, new GrabsDeallocator(_grabs));
         this._cleanHandle = handles.Cleaner;
     }
     catch (Exception throwable)
     {
         throw new LinkageError("Unable to instantiate cleaner", throwable);
     }
 }
コード例 #2
0
ファイル: GrabAllocator.cs プロジェクト: Neo4Net/Neo4Net
 internal GrabsDeallocator(Grabs grabs)
 {
     this.Grabs = grabs;
 }