Skip to content

Commit 61faf03

Browse files
authored
Merge pull request #290 from lsm5/fix-build-32-bit
Fix build on 32-bit arches
2 parents b5e5715 + 5c18de5 commit 61faf03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bcc/table.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (table *Table) Get(key []byte) ([]byte, error) {
151151
if err != nil {
152152
return nil, fmt.Errorf("get possible cpus: %w", err)
153153
}
154-
leafSize *= C.ulong(len(cpus))
154+
leafSize *= C.size_t(len(cpus))
155155
}
156156
leaf := make([]byte, leafSize)
157157
leafP := unsafe.Pointer(&leaf[0])
@@ -180,7 +180,7 @@ func (table *Table) GetP(key unsafe.Pointer) (unsafe.Pointer, error) {
180180
if err != nil {
181181
return nil, fmt.Errorf("get possible cpus: %w", err)
182182
}
183-
leafSize *= C.ulong(len(cpus))
183+
leafSize *= C.size_t(len(cpus))
184184
}
185185
leaf := make([]byte, leafSize)
186186
leafP := unsafe.Pointer(&leaf[0])
@@ -318,7 +318,7 @@ func (it *TableIterator) Next() bool {
318318
it.err = fmt.Errorf("get possible cpus: %w", err)
319319
return false
320320
}
321-
leafSize *= C.ulong(len(cpus))
321+
leafSize *= C.size_t(len(cpus))
322322
}
323323
leaf := make([]byte, leafSize)
324324

0 commit comments

Comments
 (0)