This commit is contained in:
Andreas Rumpf 2016-09-24 02:17:14 +02:00
commit 66bbf7518e
4 changed files with 114 additions and 29 deletions

View file

@ -110,6 +110,11 @@ proc copyStringRC1(src: NimString): NimString {.compilerRtl.} =
result.len = src.len
copyMem(addr(result.data), addr(src.data), src.len + 1)
proc copyDeepString(src: NimString): NimString {.inline.} =
if src != nil:
result = rawNewStringNoInit(src.len)
result.len = src.len
copyMem(addr(result.data), addr(src.data), src.len + 1)
proc hashString(s: string): int {.compilerproc.} =
# the compiler needs exactly the same hash function!