just rely on escape analysis

This commit is contained in:
Judah Caruso 2025-12-12 18:34:31 -07:00
parent c42cdcbaa6
commit 843730e11b

View file

@ -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
}