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

Method WriteMemory

src/binary-writer.cc:1248–1257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1246}
1247
1248void BinaryWriter::WriteMemory(const Memory* memory) {
1249 uint32_t flags = ComputeLimitsFlags(&memory->page_limits);
1250 const bool custom_page_size = memory->page_size != WABT_DEFAULT_PAGE_SIZE;
1251 flags |= custom_page_size ? WABT_BINARY_LIMITS_HAS_CUSTOM_PAGE_SIZE_FLAG : 0;
1252 WriteLimitsFlags(stream_, flags);
1253 WriteLimitsData(stream_, &memory->page_limits);
1254 if (custom_page_size) {
1255 WriteU32Leb128(stream_, log2_u32(memory->page_size), "memory page size");
1256 }
1257}
1258
1259void BinaryWriter::WriteGlobalHeader(const Global* global) {
1260 WriteType(stream_, global->type);

Callers

nothing calls this directly

Calls 5

ComputeLimitsFlagsFunction · 0.85
WriteLimitsFlagsFunction · 0.85
WriteLimitsDataFunction · 0.85
log2_u32Function · 0.85
WriteU32Leb128Function · 0.70

Tested by

no test coverage detected