diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-09-20 18:50:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 12:50:23 +0200 |
commit | d82bc0a29fea53a172260a3b3301b90a96974274 (patch) | |
tree | 153400133dbd85cbdba0d204a830564f23b0404f /tests/arc | |
parent | af617be67a4e038354617b272d373a6fbe583644 (diff) | |
download | Nim-d82bc0a29fea53a172260a3b3301b90a96974274.tar.gz |
items, pairs and friends now use `unCheckedInc` (#22729)
`{.push overflowChecks: off.}` works in backends. Though it could be implemented as a magic function. By inspecting the generated C code, the overflow check is eliminated in the debug or release mode.  Likewise, the index checking is probably not needed.
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/topt_no_cursor.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/arc/topt_no_cursor.nim b/tests/arc/topt_no_cursor.nim index dfb0f0a38..b24e8e5a9 100644 --- a/tests/arc/topt_no_cursor.nim +++ b/tests/arc/topt_no_cursor.nim @@ -91,7 +91,9 @@ try: `=copy`(lan_ip, splitted[1]) echo [lan_ip] echo [splitted[1]] + {.push, overflowChecks: false.} inc(i, 1) + {.pop.} finally: `=destroy`(splitted) finally: @@ -113,7 +115,9 @@ block :tmp: addInterfaceDecl(c): :tmpD = `=dup`(sym) :tmpD + {.push, overflowChecks: false.} inc(i, 1) + {.pop.} `=destroy`(shadowScope) -- end of expandArc ------------------------ --expandArc: check |