summary refs log tree commit diff stats
path: root/lib/std
diff options
context:
space:
mode:
authorGordonBGood <GordonBGood@users.noreply.github.com>2021-07-15 19:35:53 +0700
committerGitHub <noreply@github.com>2021-07-15 14:35:53 +0200
commit8c6dd2b9a9157c0e0bd822d8a80d1014fc87ecd7 (patch)
tree64de2f80265b0625334439cc9020e89276dd6db5 /lib/std
parenta6ff6e7871d757821ba2b84cb8f175f48721bb9a (diff)
downloadNim-8c6dd2b9a9157c0e0bd822d8a80d1014fc87ecd7.tar.gz
Improve description of how =trace is used (#18491)
* [skip ci] thamming_orc test created/destroyed counts match

The thamming_orc.nim code now counts all created objects being tested, not just the ones following the "first 20" test, and the position of the `destroyed += 1` counter has been adjusted so it counts all the calls that are as a result of `=trace` tracing and not just the original destruction calls.

* Improve description of how `=trace` is used

The following nuances weren't previously fully explained:

1. That `=trace` is only used by `--gc:orc`.
2. That `=trace` is almost certainly used along with `=destroy` when manual resource allocation has been used, but it is only required if there is a possibility of cyclic references in the wrapped types (ie. generic types).
3. That, currently, a forward definition is required for the second of the pair to avoid an auto compiler generation conflict.

The pattern of the use of `=trace` has also been made more extensive, showing how both a custom `=destroy` and `=trace` are used for manual allocation of resources when there is any possibility of a cyclic reference in the resource-wrapped values.

* Update doc/destructors.rst

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Diffstat (limited to 'lib/std')
0 files changed, 0 insertions, 0 deletions