> It means a bit pattern on the stack that looks like a pointer is treated like
> a pointer and so keeps objects alive for longer than they really are alive.
How is this possible and what does it mean? It's weird and wrong behavior. Such
unpredictable things should not happen, it fences off Nim from serious
developers.
Local variable "x" went out of scope and definitely is garbage. Before
"GC_FullCollect()" pointer to "x" should be out of the stack.
For me debug and release shows same expected result:
$ nim -r c gc.nim
....Debug Build...
14
finalizerCalled
Run
$ nim -v
Nim Compiler Version 0.18.0 [Linux: amd64]
Copyright (c) 2006-2018 by Andreas Rumpf
git hash: 855956bf617f68ac0be3717329e9e1181e5dc0c6
active boot switches: -d:release
Run
Maybe, something wrong with 0.18.1?
How to be sure that finalizers will be called after calling "GC_FullCollect"?