Merge pull request #4476 from yglukhov/gc-trace-fix
Fixed crash with leakDetector and threads enabled.
This commit is contained in:
commit
b668c5e2aa
1 changed files with 14 additions and 8 deletions
|
|
@ -452,7 +452,10 @@ proc rawNewObj(typ: PNimType, size: int, gch: var GcHeap): pointer =
|
|||
gcAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "newObj: 2")
|
||||
# now it is buffered in the ZCT
|
||||
res.typ = typ
|
||||
when leakDetector and not hasThreadSupport:
|
||||
when leakDetector:
|
||||
res.filename = nil
|
||||
res.line = 0
|
||||
when not hasThreadSupport:
|
||||
if framePtr != nil and framePtr.prev != nil:
|
||||
res.filename = framePtr.prev.filename
|
||||
res.line = framePtr.prev.line
|
||||
|
|
@ -503,7 +506,10 @@ proc newObjRC1(typ: PNimType, size: int): pointer {.compilerRtl.} =
|
|||
sysAssert((cast[ByteAddress](res) and (MemAlign-1)) == 0, "newObj: 2")
|
||||
# now it is buffered in the ZCT
|
||||
res.typ = typ
|
||||
when leakDetector and not hasThreadSupport:
|
||||
when leakDetector:
|
||||
res.filename = nil
|
||||
res.line = 0
|
||||
when not hasThreadSupport:
|
||||
if framePtr != nil and framePtr.prev != nil:
|
||||
res.filename = framePtr.prev.filename
|
||||
res.line = framePtr.prev.line
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue