summaryrefslogtreecommitdiff
path: root/src/wasm-allocator.h
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-03-25 23:47:26 -0700
committerBen Smith <binji@chromium.org>2016-04-02 22:32:14 -0700
commit2e4639e97f03c306374a02c4e8097add36f31aa7 (patch)
tree21e5c7bc7288da93c8dd6a6b4b3ee748ea3932c0 /src/wasm-allocator.h
parentda5e6ec567a41f6d21b9477d67b5d1960bf1dcfa (diff)
downloadwabt-2e4639e97f03c306374a02c4e8097add36f31aa7.tar.gz
wabt-2e4639e97f03c306374a02c4e8097add36f31aa7.tar.bz2
wabt-2e4639e97f03c306374a02c4e8097add36f31aa7.zip
wasm interpreter
Works by generating an instruction stream for a simple stack machine.
Diffstat (limited to 'src/wasm-allocator.h')
-rw-r--r--src/wasm-allocator.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wasm-allocator.h b/src/wasm-allocator.h
index f56404dd..7dc81987 100644
--- a/src/wasm-allocator.h
+++ b/src/wasm-allocator.h
@@ -78,6 +78,15 @@ static WASM_INLINE char* wasm_strndup(WasmAllocator* allocator,
new_s[real_len] = 0;
return new_s;
}
+
+static WASM_INLINE WasmStringSlice
+wasm_dup_string_slice(WasmAllocator* allocator, WasmStringSlice str) {
+ WasmStringSlice result;
+ result.start = wasm_strndup(allocator, str.start, str.length);
+ result.length = str.length;
+ return result;
+}
+
WASM_EXTERN_C_END
#endif /* WASM_ALLOCATOR_H_ */