summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2023-10-16 00:01:33 +0200
committerGitHub <noreply@github.com>2023-10-16 00:01:33 +0200
commit10c3ab626941d9c1ec69a2921696f4b7d0c2a6ac (patch)
treec1b8b2117bbb86101f54269ff2e66816ce4b8296 /lib/system
parent5f400983d588ec91a688453ce69cec94d310cc70 (diff)
downloadNim-10c3ab626941d9c1ec69a2921696f4b7d0c2a6ac.tar.gz
NIR: store sizes, alignments and offsets in the type graph; beginning… (#22822)
…s of a patent-pending new VM
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/seqs_v2.nim2
-rw-r--r--lib/system/strs_v2.nim3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/system/seqs_v2.nim b/lib/system/seqs_v2.nim
index ee8f2d67e..d6b26493c 100644
--- a/lib/system/seqs_v2.nim
+++ b/lib/system/seqs_v2.nim
@@ -178,7 +178,7 @@ proc newSeq[T](s: var seq[T], len: Natural) =
   shrink(s, 0)
   setLen(s, len)
 
-proc sameSeqPayload(x: pointer, y: pointer): bool {.compilerproc, inline.} =
+proc sameSeqPayload(x: pointer, y: pointer): bool {.compilerRtl, inl.} =
   result = cast[ptr NimRawSeq](x)[].p == cast[ptr NimRawSeq](y)[].p
 
 
diff --git a/lib/system/strs_v2.nim b/lib/system/strs_v2.nim
index 5e4cda186..dbee10777 100644
--- a/lib/system/strs_v2.nim
+++ b/lib/system/strs_v2.nim
@@ -209,6 +209,9 @@ proc nimAddStrV1(s: var NimStringV2; src: NimStringV2) {.compilerRtl, inl.} =
 proc nimDestroyStrV1(s: NimStringV2) {.compilerRtl, inl.} =
   frees(s)
 
+proc nimStrAtLe(s: string; idx: int; ch: char): bool {.compilerRtl, inl.} =
+  result = idx < s.len and s[idx] <= ch
+
 func capacity*(self: string): int {.inline.} =
   ## Returns the current capacity of the string.
   # See https://github.com/nim-lang/RFCs/issues/460