Skip to content

Commit

Permalink
Rename ptr to pointer in toWasmMemorySized
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Aug 17, 2022
1 parent 547fc9b commit b8ea75c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/runtime/wasmer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ func toWasmMemorySized(context wasmer.InstanceContext, data []byte) (
allocator := context.Data().(*runtime.Context).Allocator

size := uint32(len(data))
ptr, err := allocator.Allocate(size)
pointer, err = allocator.Allocate(size)
if err != nil {
return 0, fmt.Errorf("allocating: %w", err)
}

memory := context.Memory().Data()
copy(memory[ptr:ptr+size], data)
copy(memory[pointer:pointer+size], data)

return ptr, nil
return pointer, nil
}

// toWasmMemoryOptional scale encodes the byte slice `data`, writes it to wasm memory
Expand Down

0 comments on commit b8ea75c

Please sign in to comment.