コード例 #1
0
ファイル: BoundedMemory.Unix.cs プロジェクト: z77ma/runtime
            internal static AllocHGlobalHandle Allocate(nint byteLength)
            {
                AllocHGlobalHandle retVal = new AllocHGlobalHandle();

                retVal.SetHandle(Marshal.AllocHGlobal(byteLength)); // this is for unit testing; don't bother setting up a CER on Full Framework
                return(retVal);
            }
コード例 #2
0
ファイル: BoundedMemory.Unix.cs プロジェクト: z77ma/runtime
 public UnixImplementation(int elementCount)
 {
     _handle        = AllocHGlobalHandle.Allocate(checked (elementCount * (nint)sizeof(T)));
     _elementCount  = elementCount;
     _memoryManager = new BoundedMemoryManager(this);
 }