GSF.IO.Unmanaged.MemoryPoolPageList.SetMaximumPoolSize C# (CSharp) Méthode

SetMaximumPoolSize() public méthode

Changes the allowable buffer size
public SetMaximumPoolSize ( long value ) : long
value long the number of bytes to set.
Résultat long
        public long SetMaximumPoolSize(long value)
        {
            lock (m_syncRoot)
            {
                if (m_disposed)
                    throw new ObjectDisposedException(GetType().FullName);

                MaximumPoolSize = Math.Max(Math.Min(MemoryPoolCeiling, value), MemoryPool.MinimumTestedSupportedMemoryFloor);
                return MaximumPoolSize;
            }
        }

Usage Example

Exemple #1
0
        /// <summary>
        /// Changes the allowable buffer size
        /// </summary>
        /// <param name="value">the number of bytes to set.</param>
        /// <returns></returns>
        public long SetMaximumBufferSize(long value)
        {
            lock (m_syncRoot)
            {
                if (m_disposed)
                {
                    throw new ObjectDisposedException(GetType().FullName);
                }

                long rv = m_pageList.SetMaximumPoolSize(value);
                CalculateThresholds(rv, TargetUtilizationLevel);

                Log.Publish(MessageLevel.Info, MessageFlags.PerformanceIssue, "Pool Size Changed", string.Format("Memory pool maximum set to: {0}MB", rv >> 20));

                return(rv);
            }
        }