Skip to content

Commit a6d8283

Browse files
committed
fix the size of shared memory
note: a module can query the size via memory.grow.
1 parent 2c59939 commit a6d8283

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/instance.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,11 @@ memory_instance_create(struct meminst **mip,
197197
goto fail;
198198
}
199199
mp->allocated = need_in_bytes;
200-
mp->size_in_pages = need_in_pages;
201200
waiter_list_table_init(&mp->shared->tab);
202201
toywasm_mutex_init(&mp->shared->lock);
203-
} else
204-
#endif
205-
{
206-
mp->size_in_pages = mt->lim.min;
207202
}
203+
#endif
204+
mp->size_in_pages = mt->lim.min;
208205
mp->type = mt;
209206
*mip = mp;
210207
return 0;

0 commit comments

Comments
 (0)