Skip to content

Commit

Permalink
Handle fatal error: converted pointer straddles multiple allocations (#3
Browse files Browse the repository at this point in the history
)
  • Loading branch information
juniocezar authored Jul 12, 2022
1 parent 38b7f38 commit 1dd1fe9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions buffer/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ func getBuf(size int) []byte {
// Get back the array and add length and capability.
// Limiting the array to the proper capability will make this
// safe.
buf := (*[maxArraySize]byte)(v.(unsafe.Pointer))
return buf[:0:size]
return (*[maxArraySize]byte)(v.(unsafe.Pointer))[:0:size]
}
}
}
Expand Down

0 comments on commit 1dd1fe9

Please sign in to comment.