Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="size"></param>
        /// <returns></returns>
        private ManualHisDataMemoryBlock NewBlock(int size)
        {
            var re = new ManualHisDataMemoryBlock(size);

            re.Clear();
            return(re);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="block"></param>

        public void Release(ManualHisDataMemoryBlock block)
        {
            var size = (int)block.AllocSize;

            if (mFreePools.ContainsKey(size))
            {
                var vv = mFreePools[size];
                block.Reset();
                block.Clear();
                lock (mFreePools)
                {
                    vv.Enqueue(block);
                }
            }
            else
            {
                block.Dispose();
            }
        }