public void Initialize()
        {
            Dictionary <int, int> bucketSizes = new Dictionary <int, int>();

            bucketSizes.Add(32, 2);
            bucketSizes.Add(64, 1);
            bucketSizes.Add(128, 1);
            _pool = new FakeNativeMemoryChunkPool(new PoolParams(128, bucketSizes));
        }
Example #2
0
        public void Initialize()
        {
            _data  = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
            _pool  = new FakeNativeMemoryChunkPool();
            _stats = new PoolStats <NativeMemoryChunk>(_pool);

            byte[]            pooledByteArray = new byte[8];
            MockByteArrayPool byteArrayPool   = new MockByteArrayPool(pooledByteArray);

            _pooledByteStreams = new PooledByteStreams(byteArrayPool, 8);
            _factory           = new NativePooledByteBufferFactory(_pool, _pooledByteStreams);
        }
        public void Initialize()
        {
            _chunk = new FakeNativeMemoryChunk(BYTES.Length);
            _chunk.Write(0, BYTES, 0, BYTES.Length);
            _pool = new FakeNativeMemoryChunkPool();
            var poolRef = CloseableReference <NativeMemoryChunk> .of(_chunk, _pool);

            _pooledByteBuffer = new NativePooledByteBuffer(
                poolRef,
                BUFFER_LENGTH);

            poolRef.Dispose();
        }
Example #4
0
 public void Initialize()
 {
     _pool  = new FakeNativeMemoryChunkPool();
     _stats = new PoolStats <NativeMemoryChunk>(_pool);
     _data  = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
 }