## Can be shared safely between threads type SharedSeq*[T] = tuple[data: ptr UncheckedArray[T], len: int] proc alloc*(str: cstring): cstring = # Byte allocation from the given address. # There should be the corresponding manual deallocation with deallocShared ! let ret = cast[cstring](allocShared(len(str) + 1)) copyMem(ret, str, len(str) + 1) return ret proc alloc*(str: string): cstring = ## Byte allocation from the given address. ## There should be the corresponding manual deallocation with deallocShared ! var ret = cast[cstring](allocShared(str.len + 1)) let s = cast[seq[char]](str) for i in 0..