Skip to content

Memory shrinking when BULK_MEMORY not set #1706

@csegarragonz

Description

@csegarragonz

Hi,

I build WAMR with WAMR_BUILD_BULK_MEMORY set to 0 as I want all pages to have the default number of bytes. However, when loading the WASM module, the WASM loader shinks the memory and overwrites the number of pages to 1. Shouldn't this only happen if WAMR_BUILD_BULK_MEMORY is set to 1? My application expects the WASM module to have many default-sized memory pages.

Here's the offending snippet:

if (shrunk_memory_size <= init_memory_size) {
/* Reset memory info to decrease memory usage */
memory->num_bytes_per_page = shrunk_memory_size;
memory->init_page_count = 1;
LOG_VERBOSE("Shrink memory size to %d", shrunk_memory_size);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions