Exemplo n.º 1
0
            internal static UnmanagedBuffer Allocate(int bytes)
            {
                Debug.Assert(bytes >= 0);
                UnmanagedBuffer buffer = new UnmanagedBuffer();

                buffer.SetHandle(Marshal.AllocHGlobal(bytes));
                buffer.Initialize((ulong)bytes);
                return(buffer);
            }
Exemplo n.º 2
0
#pragma warning restore CA1419

            public static UnmanagedBuffer Allocate(int byteLength)
            {
                Debug.Assert(byteLength >= 0);
                UnmanagedBuffer buffer = new UnmanagedBuffer();

                buffer.SetHandle(Marshal.AllocHGlobal(byteLength));
                buffer.Initialize((ulong)byteLength);
                buffer._byteLength = byteLength;
                return(buffer);
            }
 internal static UnmanagedBuffer Allocate(int bytes)
 {
     Debug.Assert(bytes >= 0);
     UnmanagedBuffer buffer = new UnmanagedBuffer();
     buffer.SetHandle(Marshal.AllocHGlobal(bytes));
     buffer.Initialize((ulong)bytes);
     return buffer;
 }