[Concurrency] Fix memory leak around mismatched refcounting in Concurrency

This commit is contained in:
Kuba Mracek
2024-10-31 11:30:53 -07:00
parent 8f66bf170e
commit db94dc7d36
8 changed files with 133 additions and 21 deletions

View File

@@ -99,7 +99,7 @@ public struct HeapObject {
// to think about supporting (or banning) weak and/or unowned references.
var refcount: Int
// Note: The immortalRefCount value is also hard-coded in IRGen in `irgen::emitConstantObject`.
// Note: The immortalRefCount value is also hard-coded in IRGen in `irgen::emitConstantObject`, and in HeapObject.h.
#if _pointerBitWidth(_64)
static let doNotFreeBit = Int(bitPattern: 0x8000_0000_0000_0000)
static let refcountMask = Int(bitPattern: 0x7fff_ffff_ffff_ffff)