Skip to content

Commit

Permalink
fix(array): remove 64bit refcount misalignments (#5390)
Browse files Browse the repository at this point in the history
Invoking atomic operations in the reference counters resulted in an alignment panic in armv7, due to them not being 64bit aligned.

Declaring them first in the struct solved it.

See https://pkg.go.dev/sync/atomic#pkg-note-BUG fore more details

For context: I already fixed a similar issue at #4676
  • Loading branch information
2opremio authored Mar 1, 2023
1 parent 053328a commit d6af118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion array/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ func (a *String) IsConstant() bool {
}

type stringValue struct {
rc int64
data []byte

mem arrowmem.Allocator
rc int64
}

func (v *stringValue) Retain() {
Expand Down
2 changes: 1 addition & 1 deletion array/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
)

type StringBuilder struct {
refCount int64
builder *array.BinaryBuilder
mem memory.Allocator
value *stringValue
length int
capacity int
dataCapacity int
refCount int64
}

func NewStringBuilder(mem memory.Allocator) *StringBuilder {
Expand Down

0 comments on commit d6af118

Please sign in to comment.