proc free(p: pointer) {.importc: "free", nodecl.}
proc calloc(num, size: cuint): pointer {.importc: "calloc", nodecl.}
template withRef(x, y: untyped)
template `+`[T](p: ptr T; off: int): ptr T
template `[]`[T](p: ptr T; off: int): T