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