#pragma once #include #include namespace fugg { namespace wasm { class Table { wasm_rt_table_t** table; public: explicit Table(wasm_rt_table_t** table) : table(table) { } wasm_rt_elem_t* element(uintptr_t address) const { return &(*table)->data[address]; } }; static auto kTable = Table { &Z_clientZ_table }; } template static T function_ref(uintptr_t address) { const auto& element = wasm::kTable.element(address); return reinterpret_cast(element->func); } }