summary refs log tree commit diff stats
path: root/lib/system/orc.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-07-12 01:01:18 +0800
committerGitHub <noreply@github.com>2023-07-11 19:01:18 +0200
commit9471b5f964395f9b4f4f673239d4375e1910bfaa (patch)
tree6aad5c65586234f041418ae1c7396c8fb842cbbd /lib/system/orc.nim
parent9ddd768cce291e5c562cde23baeeefb47aa79c86 (diff)
downloadNim-9471b5f964395f9b4f4f673239d4375e1910bfaa.tar.gz
fixes #22256; fixes GC_disableOrc overflow (#22257)
Diffstat (limited to 'lib/system/orc.nim')
-rw-r--r--lib/system/orc.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/system/orc.nim b/lib/system/orc.nim
index 193540710..b7b98c340 100644
--- a/lib/system/orc.nim
+++ b/lib/system/orc.nim
@@ -411,7 +411,7 @@ proc registerCycle(s: Cell; desc: PNimTypeV2) =
   if roots.d == nil: init(roots)
   add(roots, s, desc)
 
-  if roots.len >= rootsThreshold+defaultThreshold:
+  if roots.len - defaultThreshold >= rootsThreshold:
     collectCycles()
   when logOrc:
     writeCell("[added root]", s, desc)