gc:destructors progress

This commit is contained in:
Andreas Rumpf 2019-09-16 23:54:21 +02:00
commit 62aa1a3cfe
6 changed files with 72 additions and 8 deletions

View file

@ -87,20 +87,28 @@ type
ntfEnumHole = 2 # enum has holes and thus `$` for them needs the slow
# version
TNimType {.compilerproc.} = object
when defined(gcDestructors):
head*: pointer
size: int
kind: TNimKind
flags: set[TNimTypeFlag]
base: ptr TNimType
node: ptr TNimNode # valid for tyRecord, tyObject, tyTuple, tyEnum
finalizer: pointer # the finalizer for the type
marker: proc (p: pointer, op: int) {.nimcall, benign.} # marker proc for GC
finalizer*: pointer # the finalizer for the type
marker*: proc (p: pointer, op: int) {.nimcall, benign.} # marker proc for GC
deepcopy: proc (p: pointer): pointer {.nimcall, benign.}
when defined(nimTypeNames):
name: cstring
nextType: ptr TNimType
instances: int # count the number of instances
sizes: int # sizes of all instances in bytes
PNimType = ptr TNimType
when defined(gcDestructors):
type
PNimType* = ptr TNimType
else:
type
PNimType = ptr TNimType
when defined(nimTypeNames):
# Declare this variable only once in system.nim