Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
lidavidm committed Feb 18, 2025
1 parent a7a81b6 commit 45b9a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arrow/memory/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestNewResizableBuffer(t *testing.T) {
assert.NotNil(t, buf.Bytes())
assert.Equal(t, exp, len(buf.Bytes()))
assert.Equal(t, exp, buf.Len())
assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf.Buf()[0])) % 64)
assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf.Buf()[0]))%64)

buf.Release() // refCount == 1
assert.NotNil(t, buf.Bytes())
Expand Down
8 changes: 4 additions & 4 deletions arrow/memory/mallocator/mallocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ func TestMallocatorAligned(t *testing.T) {

assert.GreaterOrEqual(t, int64(128), a.AllocatedBytes())

assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0])) % 64)
assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0]))%64)

buf, alloc = aligned.ReallocateAligned(96, buf, alloc)
assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0])) % 64)
assert.Equal(t, uintptr(0), uintptr(unsafe.Pointer(&buf[0]))%64)

aligned.Free(alloc)
assert.Equal(t, int64(0), a.AllocatedBytes())
Expand All @@ -160,7 +160,7 @@ func TestMallocatorAlignedBuffer(t *testing.T) {
// 20 -> round up to 64 -> add 64 bytes padding
assert.GreaterOrEqual(t, int64(128), a.AllocatedBytes())
addr := uintptr(unsafe.Pointer(&buf.Buf()[0]))
assert.Equal(t, uintptr(0), addr % 64)
assert.Equal(t, uintptr(0), addr%64)

buf.Reserve(40)
// There should have been no reallocation
Expand All @@ -170,5 +170,5 @@ func TestMallocatorAlignedBuffer(t *testing.T) {
// Now the buffer is reallocated, make sure the new address is also aligned
assert.NotEqual(t, addr, uintptr(unsafe.Pointer(&buf.Buf()[0])))
addr = uintptr(unsafe.Pointer(&buf.Buf()[0]))
assert.Equal(t, uintptr(0), addr % 64)
assert.Equal(t, uintptr(0), addr%64)
}

0 comments on commit 45b9a1c

Please sign in to comment.