Skip to content

Implement wasi.environ_{get,sizes_get}. #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix style
Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake committed Feb 24, 2021
commit 70c28727d25c9071d840fa13c960968f49d56fbd
10 changes: 5 additions & 5 deletions include/proxy-wasm/wasm_vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ class WasmVm {
*/
virtual bool setWord(uint64_t pointer, Word data) = 0;

/**
* @return the Word size in this VM.
*/
virtual size_t getWordSize() = 0;

/**
* Get the contents of the custom section with the given name or "" if it does not exist.
* @param name the name of the custom section to get.
Expand All @@ -257,11 +262,6 @@ class WasmVm {
*/
virtual std::string_view getPrecompiledSectionName() = 0;

/**
* @return the Word size in this VM.
*/
virtual size_t getWordSize() = 0;

/**
* Get typed function exported by the WASM module.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/null/null_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ bool NullVm::getWord(uint64_t pointer, Word *data) {
return true;
}

size_t NullVm::getWordSize() { return sizeof(uint64_t); }

std::string_view NullVm::getCustomSection(std::string_view /* name */) {
// Return nothing: there is no WASM file.
return {};
Expand All @@ -112,6 +114,4 @@ std::string_view NullVm::getPrecompiledSectionName() {
return {};
}

size_t NullVm::getWordSize() { return sizeof(uint64_t); }

} // namespace proxy_wasm