Beispiel #1
0
        public PlatformMemoryPool Pool()
        {
            PlatformMemoryPool pool = _threadLocPool.Value;

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

                _threadLocPool.Value = pool;
            }

            return(pool);
        }
        /// <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;
        }