Esempio n. 1
0
        public static void ResizeBuffer()
        {
            var allocator = MemoryAllocator.CreateArrayAllocator <byte>();
            var buffer    = default(MemoryOwner <byte>);

            buffer.Resize(10, false, allocator);
            Equal(10, buffer.Length);

            buffer.Resize(3, false, allocator);
            Equal(3, buffer.Length);

            True(buffer.TryResize(10));
        }
Esempio n. 2
0
 public static void ArrayAllocation()
 {
     using var owner = MemoryAllocator.CreateArrayAllocator <int>().Invoke(4, false);
     Equal(4, owner.Length);
 }