gc:destructors progress
This commit is contained in:
parent
77c6425e65
commit
62aa1a3cfe
6 changed files with 72 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue