Ejemplo n.º 1
0
        internal static MutexHandle Allocate()
        {
            var result = default(MutexHandle);

            result.AttributePointer = Memory.AllocHGlobal(pthread_get_mutexattr_size());
            result.MutexPointer     = Memory.AllocHGlobal(pthread_get_mutex_size());
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Allocates unmanaged memory.
 /// </summary>
 /// <param name="size">The number of bytes to allocate.</param>
 public static IntPtr AllocHGlobal(int size)
 {
     return((IntPtr)Memory.AllocHGlobal((ulong)size));
 }