Skip to content

Commit

Permalink
fix nil ptr error on apple m1 chip (#109)
Browse files Browse the repository at this point in the history
* Update val.go

* Update val.go
  • Loading branch information
elee1766 authored Aug 31, 2023
1 parent 6b8e231 commit 4a44921
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mdbx/val.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,8 @@ func wrapVal(b []byte) *C.MDBX_val {
}

func castToBytes(val *C.MDBX_val) []byte {
if val.iov_len == 0 {
return []byte{}
}
return (*[valMaxSize]byte)(val.iov_base)[:val.iov_len:val.iov_len]
}

0 comments on commit 4a44921

Please sign in to comment.