Ejemplo n.º 1
0
        public PlatformMemoryPool Pool()
        {
            PlatformMemoryPool pool = _threadLocPool.Value;

            if (pool == null)
            {
                pool = new PlatformMemoryPool();

                _threadLocPool.Value = pool;
            }

            return(pool);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets or creates thread-local memory pool.
        /// </summary>
        /// <returns>Memory pool.</returns>
        public PlatformMemoryPool Pool()
        {
            PlatformMemoryPool pool = _threadLocPool.Value;

            if (pool == null)
            {
                pool = new PlatformMemoryPool();

                _threadLocPool.Value = pool;
            }

            return pool;
        }