Example #1
0
            public unsafe void AllocatesAlignedToMultipleOf64(int size)
            {
                var buffer = ArrowBuffer.Allocate(size, _memoryPoolFixture.MemoryPool);

                using (var pin = buffer.Memory.Pin())
                {
                    var ptr = new IntPtr(pin.Pointer);
                    Assert.True(ptr.ToInt64() % 64 == 0);
                }
            }
Example #2
0
            public void HasZeroPadding()
            {
                var buffer = ArrowBuffer.Allocate(32, _memoryPoolFixture.MemoryPool);
                var span   = buffer.GetSpan <byte>();

                foreach (var b in span)
                {
                    Assert.Equal(0, b);
                }
            }
Example #3
0
            public void AllocatesWithExpectedPadding(int size, int expectedCapacity)
            {
                var buffer = ArrowBuffer.Allocate(size, _memoryPoolFixture.MemoryPool);

                Assert.Equal(buffer.Capacity, expectedCapacity);
            }