diff options
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r-- | src/runtime/malloc.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 5866a4597b..b044e29d95 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -847,6 +847,11 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { if size == 0 { return unsafe.Pointer(&zerobase) } + + // It's possible for any malloc to trigger sweeping, which may in + // turn queue finalizers. Record this dynamic lock edge. + lockRankMayQueueFinalizer() + userSize := size if asanenabled { // Refer to ASAN runtime library, the malloc() function allocates extra memory, |