Exemple #1
0
        unsafe protected void CreateMemory(LibuvFunctions uv, int threadId, int size)
        {
            _uv      = uv;
            ThreadId = threadId;

            handle            = Marshal.AllocCoTaskMem(size);
            *(IntPtr *)handle = GCHandle.ToIntPtr(GCHandle.Alloc(this, _handleType));
        }
Exemple #2
0
 protected void CreateHandle(
     LibuvFunctions uv,
     int threadId,
     int size,
     Action <Action <IntPtr>, IntPtr> queueCloseHandle)
 {
     _queueCloseHandle = queueCloseHandle;
     CreateMemory(uv, threadId, size);
 }
        public void Init(LibuvFunctions uv)
        {
            CreateMemory(
                uv,
                Thread.CurrentThread.ManagedThreadId,
                uv.loop_size());

            _uv.loop_init(this);
        }