You can instruct the Nim GC to not do that using GC_ref (<a href="http:&#x2F;&#x2F;nim-lang.org&#x2F;docs&#x2F;system.html#GC_ref,string" rel="nofollow">http:&#x2F;&#x2F;nim-lang.org&#x2F;docs&#x2F;system.html#GC_ref,string</a>).