Пример #1
0
            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
 public UnixImplementation(int elementCount)
 {
     _handle        = AllocHGlobalHandle.Allocate(checked (elementCount * (nint)sizeof(T)));
     _elementCount  = elementCount;
     _memoryManager = new BoundedMemoryManager(this);
 }