diff --git a/alloc/allocators.go b/alloc/allocators.go index d1e4498..f233074 100644 --- a/alloc/allocators.go +++ b/alloc/allocators.go @@ -157,11 +157,10 @@ func Nil() Allocator { // Temporary wraps an Allocator, restoring it to its previous state when Reset is called. func Temporary(alloc Allocator) Allocator { - watermark := new(uintptr) - *watermark = Save(alloc) + watermark := Save(alloc) return func(a Action, size, align uintptr, wm *uintptr) (unsafe.Pointer, error) { if a == ActionReset { - Restore(alloc, *watermark) + Restore(alloc, watermark) return nil, nil }