C# 클래스 GAudio.GATDataAllocator

Pre-allocates a large float[] to use as virtual memory and avoid any garbage collection. All calls to GATActiveSampleBank and GATReamplingSampleBank GetProcessedSample methods result in a virtual allocation from GATManager's default GATDataAllocator instance.
상속: IDisposable
파일 보기 프로젝트 열기: gregzo/G-Audio 1 사용 예제들

공개 메소드들

메소드 설명
CleanUp ( ) : void
Defragment ( ) : void

Defragments contiguous free chunks. Automatically called when a chunk of appropriate size cannot be recycled.

Dispose ( ) : void
GATDataAllocator ( InitializationSettings initSettings ) : System

Initializes a new instance of the GATDataAllocator class. In most cases, only the default allocator initialized by GATManager is required.

GetDataContainer ( int size ) : GATData

Finds and virtually allocates a GATManagedData instance before returning it as a GATData reference. First, the algorithm looks at the free chunks bin of appropriate size. If the bin doesn't hold any chunk, it will check if there is enough unfragmented space. If there isn't, it will look at bins holding larger chunks and fragment one if found. Finally, it will attempt defragmenting and run again, before logging an out of memory error.

GetDebugInfo ( ) : List

Gets information regarding each allocated chunk.

GetFixedDataContainer ( int size, string description ) : GATData

Allocates a fixed chunk of memory. Fixed chunks cannot be freed, but may be of any size. For debugging ease, a description is required when requesting a fixed chunk.

GetFixedDebugInfo ( ) : List

Gets information regarding fixed allocations.

NbOfAvailableChunksForSize ( int size ) : int

A conservative estimate of the available number of chunks. Takes into account both unfragmented memory and recyclable previously allocated chunks.

비공개 메소드들

메소드 설명
AddToFreeChunksBins ( GATManagedData chunk ) : void
Dispose ( bool explicitly ) : void
GetBinIndexForSize ( int size ) : int
GetOrMakeChunk ( ) : GATManagedData
InitCursors ( ) : void
TryFragmentBins ( int fromBinIndex, int binSize, GATManagedData &chunk ) : bool

메소드 상세

CleanUp() 공개 메소드

public CleanUp ( ) : void
리턴 void

Defragment() 공개 메소드

Defragments contiguous free chunks. Automatically called when a chunk of appropriate size cannot be recycled.
public Defragment ( ) : void
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GATDataAllocator() 공개 메소드

Initializes a new instance of the GATDataAllocator class. In most cases, only the default allocator initialized by GATManager is required.
public GATDataAllocator ( InitializationSettings initSettings ) : System
initSettings InitializationSettings
리턴 System

GetDataContainer() 공개 메소드

Finds and virtually allocates a GATManagedData instance before returning it as a GATData reference. First, the algorithm looks at the free chunks bin of appropriate size. If the bin doesn't hold any chunk, it will check if there is enough unfragmented space. If there isn't, it will look at bins holding larger chunks and fragment one if found. Finally, it will attempt defragmenting and run again, before logging an out of memory error.
public GetDataContainer ( int size ) : GATData
size int /// Size of the chunk to virtually allocate. ///
리턴 GATData

GetDebugInfo() 공개 메소드

Gets information regarding each allocated chunk.
public GetDebugInfo ( ) : List
리턴 List

GetFixedDataContainer() 공개 메소드

Allocates a fixed chunk of memory. Fixed chunks cannot be freed, but may be of any size. For debugging ease, a description is required when requesting a fixed chunk.
public GetFixedDataContainer ( int size, string description ) : GATData
size int
description string
리턴 GATData

GetFixedDebugInfo() 공개 메소드

Gets information regarding fixed allocations.
public GetFixedDebugInfo ( ) : List
리턴 List

NbOfAvailableChunksForSize() 공개 메소드

A conservative estimate of the available number of chunks. Takes into account both unfragmented memory and recyclable previously allocated chunks.
public NbOfAvailableChunksForSize ( int size ) : int
size int
리턴 int