Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2019 04:31
What would you like to do?
void print_str(wasmer_instance_context_t *ctx, int32_t ptr, int32_t len)
print_str_called = true;
wasmer_memory_t *memory = wasmer_instance_context_memory(ctx, 0);
uint32_t mem_len = wasmer_memory_length(memory);
uint8_t *mem_bytes = wasmer_memory_data(memory);
printf("%.*s", len, mem_bytes + ptr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment