wasmer_emscripten/storage.rs
1// use crate::webassembly::Memory;
2
3pub fn align_memory(ptr: u32) -> u32 {
4 (ptr + 15) & !15
5}
6
7pub fn static_alloc(static_top: &mut u32, size: u32) -> u32 {
8 let old_static_top = *static_top;
9 // NOTE: The `4294967280` is a u32 conversion of -16 as gotten from emscripten.
10 *static_top = (*static_top + size + 15) & 4294967280;
11 old_static_top
12}