mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-29 10:43:57 +00:00
--gc:destructors now means Nim uses pure refcounting (#12557)
This commit is contained in:
@@ -87,7 +87,7 @@ type
|
||||
ntfEnumHole = 2 # enum has holes and thus `$` for them needs the slow
|
||||
# version
|
||||
TNimType {.compilerproc.} = object
|
||||
when defined(gcDestructors):
|
||||
when defined(gcHooks):
|
||||
head*: pointer
|
||||
size*: int
|
||||
kind: TNimKind
|
||||
@@ -103,7 +103,7 @@ type
|
||||
instances: int # count the number of instances
|
||||
sizes: int # sizes of all instances in bytes
|
||||
|
||||
when defined(gcDestructors):
|
||||
when defined(gcHooks):
|
||||
type
|
||||
PNimType* = ptr TNimType
|
||||
else:
|
||||
|
||||
@@ -507,10 +507,10 @@ else:
|
||||
elif defined(gcRegions):
|
||||
# XXX due to bootstrapping reasons, we cannot use compileOption("gc", "stack") here
|
||||
include "system/gc_regions"
|
||||
elif defined(nimV2) or defined(gcDestructors):
|
||||
elif defined(nimV2) or usesDestructors:
|
||||
var allocator {.rtlThreadVar.}: MemRegion
|
||||
instantiateForRegion(allocator)
|
||||
when defined(gcDestructors):
|
||||
when defined(gcHooks):
|
||||
include "system/gc_hooks"
|
||||
elif defined(gcMarkAndSweep):
|
||||
# XXX use 'compileOption' here
|
||||
|
||||
@@ -226,7 +226,7 @@ when not defined(useNimRtl):
|
||||
cl: var ReprClosure) =
|
||||
# we know that p is not nil here:
|
||||
when declared(CellSet):
|
||||
when defined(boehmGC) or defined(gogc) or defined(nogc) or defined(gcDestructors):
|
||||
when defined(boehmGC) or defined(gogc) or defined(nogc) or usesDestructors:
|
||||
var cell = cast[PCell](p)
|
||||
else:
|
||||
var cell = usrToCell(p)
|
||||
|
||||
@@ -148,7 +148,7 @@ else:
|
||||
proc threadProcWrapStackFrame[TArg](thrd: ptr Thread[TArg]) =
|
||||
when defined(boehmgc):
|
||||
boehmGC_call_with_stack_base(threadProcWrapDispatch[TArg], thrd)
|
||||
elif not defined(nogc) and not defined(gogc) and not defined(gcRegions) and not defined(gcDestructors):
|
||||
elif not defined(nogc) and not defined(gogc) and not defined(gcRegions) and not usesDestructors:
|
||||
var p {.volatile.}: proc(a: ptr Thread[TArg]) {.nimcall, gcsafe.} =
|
||||
threadProcWrapDispatch[TArg]
|
||||
# init the GC for refc/markandsweep
|
||||
|
||||
Reference in New Issue
Block a user