Skip to content

Commit

Permalink
make meminst->size_in_pages atomic
Browse files Browse the repository at this point in the history
for longer term, i'm thinking to make memory.grow suspend
all other threads instead.
  • Loading branch information
yamt committed Apr 5, 2023
1 parent 0dfcea7 commit fe49507
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ struct funcinst {

struct meminst {
uint8_t *data;
uint32_t size_in_pages; /* overrides type->min */
/* Note: memory_getptr2 reads size_in_pages w/o locks */
_Atomic uint32_t size_in_pages; /* overrides type->min */
uint32_t allocated;
const struct memtype *type;

Expand Down

0 comments on commit fe49507

Please sign in to comment.