MCPcopy Create free account
hub / github.com/WebAssembly/wabt / GetMemoryAPIString

Function GetMemoryAPIString

src/c-writer.cc:1392–1411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1390}
1391
1392static std::string GetMemoryAPIString(const Memory& memory, std::string api) {
1393 std::string suffix;
1394 if (memory.page_limits.is_shared) {
1395 suffix += "_shared";
1396 }
1397
1398 // Memory load and store routines can be optimized for default-page-size,
1399 // 32-bit memories (by using hardware to bounds-check memory access).
1400 // Append "_default32" to these function names to choose the (possibly) fast
1401 // path.
1402 //
1403 // We don't need to do this for runtime routines; those can check the
1404 // wasm_rt_memory_t structure.
1405 if (api.substr(0, 8) != "wasm_rt_" &&
1406 memory.page_size == WABT_DEFAULT_PAGE_SIZE &&
1407 memory.page_limits.is_64 == false) {
1408 suffix += "_default32";
1409 }
1410 return api + suffix;
1411}
1412
1413void CWriter::WriteInitExpr(const ExprList& expr_list) {
1414 if (expr_list.empty()) {

Callers 3

WriteDataInitializersMethod · 0.85
WriteFreeMethod · 0.85
WriteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected