Esempio n. 1
0
        public static void Unpin(IntPtr ptr, IntPtr state)
        {
            try
            {
                //Grab the info for the given pointer
                ActiveMemoryInfo info = _activeMemory[ptr];

                //First we return the object back to its pool
                if (EnablePooling)
                {
                    _pooledMemory[info.key].Enqueue(info.handle.Target);
                }

                //Then we remove the pointer from the active memory map
                ActiveMemoryInfo value;

                _activeMemory.TryRemove(ptr, out value);

                //Finally we unpin the memory
                info.handle.Free();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }
        }
Esempio n. 2
0
        public void Unpin(IntPtr ptr)
        {
            try {
                //Grab the info for the given pointer
                ActiveMemoryInfo info = _activeMemory[ptr];

                //First we return the object back to its pool
                _pooledMemory[info.key].Enqueue(info.handle.Target);

                //Then we remove the pointer from the active memory map
                _activeMemory.Remove(ptr);

                //Finally we unpin the memory
                info.handle.Free();
            } catch (Exception) { }
        }
Esempio n. 3
0
        public static void Unpin(IntPtr ptr, IntPtr state)
        {
            try {
                //Grab the info for the given pointer
                ActiveMemoryInfo info = _activeMemory[ptr];

                //First we return the object back to its pool
                _pooledMemory[info.key].Enqueue(info.handle.Target);

                //Then we remove the pointer from the active memory map
                _activeMemory.Remove(ptr);

                //Finally we unpin the memory
                info.handle.Free();
            } catch (Exception e) {
                //UnityEngine.Debug.LogException(e);
                //Log.Error(e);
                Trace.TraceError(e.ToString());
            }
        }