This is an automated email from the ASF dual-hosted git repository.
zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git
The following commit(s) were added to refs/heads/main by this push:
new 1d3100c fix(arrow/bitutil): fix bitmap ops on 32-bit platforms (#277)
1d3100c is described below
commit 1d3100c7b0e5ecc821aa09662c85fe594d2cf8bb
Author: Matt Topol <[email protected]>
AuthorDate: Wed Feb 12 15:20:01 2025 -0500
fix(arrow/bitutil): fix bitmap ops on 32-bit platforms (#277)
### Rationale for this change
Fixes the broken 32-bit arch tests identified by #32
### What changes are included in this PR?
Defining the `opAligned` pure go fallback methods for bitmap operations.
### Are these changes tested?
Yes, it makes the tests succeed properly on `GOARCH=386`
### Are there any user-facing changes?
No.
---
arrow/bitutil/bitmaps.go | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/arrow/bitutil/bitmaps.go b/arrow/bitutil/bitmaps.go
index 0ac7ff5..c6b156e 100644
--- a/arrow/bitutil/bitmaps.go
+++ b/arrow/bitutil/bitmaps.go
@@ -465,20 +465,24 @@ type bitOp struct {
var (
bitAndOp = bitOp{
- opWord: func(l, r uint64) uint64 { return l & r },
- opByte: func(l, r byte) byte { return l & r },
+ opWord: func(l, r uint64) uint64 { return l & r },
+ opByte: func(l, r byte) byte { return l & r },
+ opAligned: alignedBitAndGo,
}
bitOrOp = bitOp{
- opWord: func(l, r uint64) uint64 { return l | r },
- opByte: func(l, r byte) byte { return l | r },
+ opWord: func(l, r uint64) uint64 { return l | r },
+ opByte: func(l, r byte) byte { return l | r },
+ opAligned: alignedBitOrGo,
}
bitAndNotOp = bitOp{
- opWord: func(l, r uint64) uint64 { return l &^ r },
- opByte: func(l, r byte) byte { return l &^ r },
+ opWord: func(l, r uint64) uint64 { return l &^ r },
+ opByte: func(l, r byte) byte { return l &^ r },
+ opAligned: alignedBitAndNotGo,
}
bitXorOp = bitOp{
- opWord: func(l, r uint64) uint64 { return l ^ r },
- opByte: func(l, r byte) byte { return l ^ r },
+ opWord: func(l, r uint64) uint64 { return l ^ r },
+ opByte: func(l, r byte) byte { return l ^ r },
+ opAligned: alignedBitXorGo,
}
)