ORC and stdlib optimizations (#15362)

This commit is contained in:
Andreas Rumpf 2020-09-19 00:27:43 +02:00 • committed by GitHub
commit 9a34009f00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 29 deletions

View file

@ -52,7 +52,8 @@ proc prepareAdd(s: var NimStringV2; addlen: int) {.compilerRtl.} =
s.p = cast[ptr NimStrPayload](reallocShared0(s.p, contentSize(oldCap), contentSize(newCap)))
s.p.cap = newCap
proc nimAddCharV1(s: var NimStringV2; c: char) {.compilerRtl.} =
proc nimAddCharV1(s: var NimStringV2; c: char) {.compilerRtl, inline.} =
#if (s.p == nil) or (s.len+1 > s.p.cap and not strlitFlag):
prepareAdd(s, 1)
s.p.data[s.len] = c
s.p.data[s.len+1] = '\0'