diff options
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/shed.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/src/shed.c b/runtime/src/shed.c index bee5c439..2de1798e 100644 --- a/runtime/src/shed.c +++ b/runtime/src/shed.c @@ -17,11 +17,12 @@ ShedObject const shed_unit = 0; uint32_t const PAGE_SIZE = 65536; -void* wasm_memory_grow(uint32_t pages); +uint32_t wasm_memory_grow(uint32_t pages); void* shed__runtime__alloc(uint32_t size) { // TODO: implement a more sensible scheme. This allocates a new page on every request. - return wasm_memory_grow((size + PAGE_SIZE - 1) / PAGE_SIZE); + uint32_t previous_page_count = wasm_memory_grow((size + PAGE_SIZE - 1) / PAGE_SIZE); + return (void*) (previous_page_count * PAGE_SIZE); } typedef struct __wasi_ciovec_t { |
