Skip to content

Commit d981c85

Browse files
authored
wavm: rename envoyFunction to hostFunction (proxy-wasm#85)
Signed-off-by: mathetake <[email protected]>
1 parent f08baac commit d981c85

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wavm/wavm.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ struct Wavm : public WasmVm {
258258
std::map<std::string, Intrinsics::Module> intrinsic_modules_;
259259
std::map<std::string, WAVM::Runtime::GCPointer<WAVM::Runtime::Instance>>
260260
intrinsic_module_instances_;
261-
std::vector<std::unique_ptr<Intrinsics::Function>> envoyFunctions_;
261+
std::vector<std::unique_ptr<Intrinsics::Function>> host_functions_;
262262
uint8_t *memory_base_ = nullptr;
263263
AbiVersion abi_version_ = AbiVersion::Unknown;
264264
};
@@ -268,7 +268,7 @@ Wavm::~Wavm() {
268268
context_ = nullptr;
269269
intrinsic_module_instances_.clear();
270270
intrinsic_modules_.clear();
271-
envoyFunctions_.clear();
271+
host_functions_.clear();
272272
if (compartment_) {
273273
ASSERT(tryCollectCompartment(std::move(compartment_)));
274274
}
@@ -415,7 +415,7 @@ std::string_view Wavm::getPrecompiledSectionName() { return "wavm.precompiled_ob
415415
std::unique_ptr<WasmVm> createWavmVm() { return std::make_unique<proxy_wasm::Wavm::Wavm>(); }
416416

417417
template <typename R, typename... Args>
418-
IR::FunctionType inferEnvoyFunctionType(R (*)(void *, Args...)) {
418+
IR::FunctionType inferHostFunctionType(R (*)(void *, Args...)) {
419419
return IR::FunctionType(IR::inferResultType<R>(), IR::TypeTuple({IR::inferValueType<Args>()...}),
420420
IR::CallingConvention::intrinsic);
421421
}
@@ -426,9 +426,9 @@ template <typename R, typename... Args>
426426
void registerCallbackWavm(WasmVm *vm, std::string_view module_name, std::string_view function_name,
427427
R (*f)(Args...)) {
428428
auto wavm = static_cast<proxy_wasm::Wavm::Wavm *>(vm);
429-
wavm->envoyFunctions_.emplace_back(new Intrinsics::Function(
429+
wavm->host_functions_.emplace_back(new Intrinsics::Function(
430430
&wavm->intrinsic_modules_[std::string(module_name)], function_name.data(),
431-
reinterpret_cast<void *>(f), inferEnvoyFunctionType(f)));
431+
reinterpret_cast<void *>(f), inferHostFunctionType(f)));
432432
}
433433

434434
template void registerCallbackWavm<void, void *>(WasmVm *vm, std::string_view module_name,

0 commit comments

Comments
 (0)