summaryrefslogtreecommitdiffhomepage
path: root/pkg/sync/generic_atomicptrmap_unsafe.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sync/generic_atomicptrmap_unsafe.go')
-rw-r--r--pkg/sync/generic_atomicptrmap_unsafe.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/pkg/sync/generic_atomicptrmap_unsafe.go b/pkg/sync/generic_atomicptrmap_unsafe.go
index c70dda6dd..3e98cb309 100644
--- a/pkg/sync/generic_atomicptrmap_unsafe.go
+++ b/pkg/sync/generic_atomicptrmap_unsafe.go
@@ -17,8 +17,6 @@
package atomicptrmap
import (
- "reflect"
- "runtime"
"sync/atomic"
"unsafe"
@@ -372,9 +370,8 @@ func (shard *apmShard) rehash(oldSlots unsafe.Pointer) {
// Allocate the new table.
newSlotsSlice := make([]apmSlot, newSize)
- newSlotsReflect := (*reflect.SliceHeader)(unsafe.Pointer(&newSlotsSlice))
- newSlots := unsafe.Pointer(newSlotsReflect.Data)
- runtime.KeepAlive(newSlotsSlice)
+ newSlotsHeader := (*gohacks.SliceHeader)(unsafe.Pointer(&newSlotsSlice))
+ newSlots := newSlotsHeader.Data
newMask := newSize - 1
// Start a writer critical section now so that racing users of the old