diff --git a/src/apis/emscripten/memory.rs b/src/apis/emscripten/memory.rs index be288f397..4caf652bc 100644 --- a/src/apis/emscripten/memory.rs +++ b/src/apis/emscripten/memory.rs @@ -22,7 +22,7 @@ pub extern "C" fn _emscripten_memcpy_big( pub extern "C" fn get_total_memory(_instance: &mut Instance) -> u32 { debug!("emscripten::get_total_memory"); // instance.memories[0].current_pages() - 16777216 + 16_777_216 } /// emscripten: enlargeMemory diff --git a/src/apis/emscripten/mod.rs b/src/apis/emscripten/mod.rs index d581c3f90..538b4dbba 100644 --- a/src/apis/emscripten/mod.rs +++ b/src/apis/emscripten/mod.rs @@ -22,11 +22,11 @@ pub use self::storage::{align_memory, static_alloc}; pub use self::utils::{is_emscripten_module, allocate_on_stack, allocate_cstr_on_stack}; // TODO: Magic number - how is this calculated? -const TOTAL_STACK: u32 = 5242880; +const TOTAL_STACK: u32 = 5_242_880; // TODO: Magic number - how is this calculated? const DYNAMICTOP_PTR_DIFF: u32 = 1088; // TODO: make this variable -const STATIC_BUMP: u32 = 215536; +const STATIC_BUMP: u32 = 215_536; fn stacktop(static_bump: u32) -> u32 { align_memory(dynamictop_ptr(static_bump) + 4) diff --git a/src/apis/emscripten/storage.rs b/src/apis/emscripten/storage.rs index 382bc2e43..7d5633b5b 100644 --- a/src/apis/emscripten/storage.rs +++ b/src/apis/emscripten/storage.rs @@ -16,7 +16,7 @@ pub fn static_alloc(size: u32, static_top: &mut u32, memory: &LinearMemory) -> u let old_static_top = *static_top; let total_memory = memory.maximum_size() * LinearMemory::PAGE_SIZE; // NOTE: The `4294967280` is a u32 conversion of -16 as gotten from emscripten. - *static_top = (*static_top + size + 15) & 4294967280; + *static_top = (*static_top + size + 15) & 4_294_967_280; assert!( *static_top < total_memory, "not enough memory for static allocation - increase total_memory!"