parent
9eeff690d5
commit
ce40ed18bb
2 changed files with 15 additions and 10 deletions
|
|
@ -37,7 +37,8 @@ proc resize(old: int): int {.inline.} =
|
||||||
else: result = old * 3 div 2 # for large arrays * 3/2 is better
|
else: result = old * 3 div 2 # for large arrays * 3/2 is better
|
||||||
|
|
||||||
proc prepareAdd(s: var NimStringV2; addlen: int) {.compilerRtl.} =
|
proc prepareAdd(s: var NimStringV2; addlen: int) {.compilerRtl.} =
|
||||||
if isLiteral(s) and addlen > 0:
|
if isLiteral(s):
|
||||||
|
if addlen > 0:
|
||||||
let oldP = s.p
|
let oldP = s.p
|
||||||
# can't mutate a literal, so we need a fresh copy here:
|
# can't mutate a literal, so we need a fresh copy here:
|
||||||
let allocator = getLocalAllocator()
|
let allocator = getLocalAllocator()
|
||||||
|
|
|
||||||
|
|
@ -210,5 +210,9 @@ proc staticTests =
|
||||||
nonStaticTests()
|
nonStaticTests()
|
||||||
staticTests()
|
staticTests()
|
||||||
|
|
||||||
|
# bug #12965
|
||||||
|
let xaa = @[""].join()
|
||||||
|
let xbb = @["", ""].join()
|
||||||
|
|
||||||
let (a, d) = allocCounters()
|
let (a, d) = allocCounters()
|
||||||
discard cprintf("%ld %ld\n", a, d)
|
discard cprintf("%ld %ld\n", a, d)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue