Could we use `resize!` here instead and avoid `ccall`ing Julia's internals, or would the overhead be too great?