aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 46200037e2..25caf0625b 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -1670,6 +1670,12 @@ func postMallocgcDebug(x unsafe.Pointer, elemsize uintptr, typ *_type) {
traceRelease(trace)
}
}
+
+ // N.B. elemsize == 0 indicates a tiny allocation, since no new slot was
+ // allocated to fulfill this call to mallocgc.
+ if debug.checkfinalizers != 0 && elemsize == 0 {
+ setTinyBlockContext(unsafe.Pointer(alignDown(uintptr(x), maxTinySize)))
+ }
}
// deductAssistCredit reduces the current G's assist credit