Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ángel Ortuño <[email protected]>
  • Loading branch information
ortuman committed Mar 12, 2024
1 parent 4ce82e4 commit 5f4246a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monotonic_arena.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func (s *monotonicBuffer) alloc(size, alignment uintptr) (unsafe.Pointer, bool)
ptr := unsafe.Pointer(uintptr(s.ptr) + s.offset + alignOffset)
s.offset += allocSize

b := unsafe.Slice((*byte)(ptr), size)

// This piece of code will be translated into a runtime.memclrNoHeapPointers
// invocation by the compiler, which is an assembler optimized implementation.
// Architecture specific code can be found at src/runtime/memclr_$GOARCH.s
// in Go source (since https://codereview.appspot.com/137880043).
b := unsafe.Slice((*byte)(ptr), size)

for i := range b {
b[i] = 0
}
Expand Down

0 comments on commit 5f4246a

Please sign in to comment.