mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #24770 e.g. `seq[(ObjectWithDestructors, string)]`/ For refc, a seq with elements that have destructors will have `hasAsgn` flags. The flag is the criteria whether a seq is thought as `containsGarbageCollectedRef`. i.e. whether to `registerTraverseProc` for the type. The culprit seems to be that `searchTypeForAux` doesn't consider the element type of sequence, even it contains a string that should belong to `GarbageCollectedRef`. With this PR: It now generates ``` nimRegisterThreadLocalMarker(TM__mSF73dT1lSI7DG58StKHLQ_5); ``` in refc
This commit is contained in:
@@ -18,7 +18,7 @@ proc registerTraverseProc(p: BProc, v: PSym) =
|
||||
var traverseProc = ""
|
||||
if p.config.selectedGC in {gcMarkAndSweep, gcHooks, gcRefc} and
|
||||
optOwnedRefs notin p.config.globalOptions and
|
||||
containsGarbageCollectedRef(v.loc.t):
|
||||
containsManagedMemory(v.loc.t):
|
||||
# we register a specialized marked proc here; this has the advantage
|
||||
# that it works out of the box for thread local storage then :-)
|
||||
traverseProc = genTraverseProcForGlobal(p.module, v, v.info)
|
||||
|
||||
Reference in New Issue
Block a user