Exemple #1
0
        /// <summary>
        /// 获取内存池的详细信息
        /// </summary>
        /// <param name="strName"></param>
        /// <param name="iFreeCount"></param>
        /// <param name="iInitialCapacity"></param>
        /// <param name="iCurrentCapacity"></param>
        /// <param name="iBufferSize"></param>
        /// <param name="iMisses"></param>
        public BufferPool.PoolInfo GetPoolInfo()
        {
            BufferPool.PoolInfo poolInfo = new BufferPool.PoolInfo();

            // 该可以不锁定的,因只是读取数据而已
            poolInfo.Name            = m_BufferName;
            poolInfo.Misses          = m_Misses;
            poolInfo.BufferSize      = m_BufferSize;
            poolInfo.FreeCount       = m_FreeBuffers.Count;
            poolInfo.InitialCapacity = m_InitialCapacity;
            poolInfo.CurrentCapacity = m_InitialCapacity * (m_Misses + 1);

            return(poolInfo);
        }
        /// <summary>
        /// 获取内存池的详细信息
        /// </summary>
        /// <param name="strName"></param>
        /// <param name="iFreeCount"></param>
        /// <param name="iInitialCapacity"></param>
        /// <param name="iCurrentCapacity"></param>
        /// <param name="iBufferSize"></param>
        /// <param name="iMisses"></param>
        public BufferPool.PoolInfo GetPoolInfo()
        {
            BufferPool.PoolInfo poolInfo = new BufferPool.PoolInfo();

            // 该可以不锁定的,因只是读取数据而已
            poolInfo.Name = m_BufferName;
            poolInfo.Misses = m_Misses;
            poolInfo.BufferSize = m_BufferSize;
            poolInfo.FreeCount = m_FreeBuffers.Count;
            poolInfo.InitialCapacity = m_InitialCapacity;
            poolInfo.CurrentCapacity = m_InitialCapacity * (m_Misses + 1);

            return poolInfo;
        }