Exemple #1
0
        public ThreadLocalMessageBufferPool(int maxsize)
        {
            stacks = new Stack <T[]>();

            this.id       = this.GetHashCode();
            this.typesize = ObjectSize.ManagedSize(typeof(T));
        }
Exemple #2
0
        public LockedBufferPool(int maxsize)
        {
            stacks = new Stack <T[]> [maxsize + 1];
            for (int i = 0; i < stacks.Length; i++)
            {
                stacks[i] = new Stack <T[]>(1);
            }

            this.id       = this.GetHashCode();
            this.typesize = ObjectSize.ManagedSize(typeof(T));
        }