Remove static_top fn

This commit is contained in:
Steve Akinyemi 2018-12-07 18:19:28 +01:00
parent 15e1e5aee0
commit 540b5be395
2 changed files with 4 additions and 8 deletions

View File

@ -46,11 +46,6 @@ fn dynamictop_ptr(static_bump: u32) -> u32 {
static_bump + DYNAMICTOP_PTR_DIFF
}
pub fn statictop(static_bump: u32) -> u32 {
GLOBAL_BASE + 5520
}
pub fn emscripten_set_up_memory(memory: &mut LinearMemory) {
let dynamictop_ptr = dynamictop_ptr(STATIC_BUMP) as usize;
let dynamictop_ptr_offset = dynamictop_ptr + mem::size_of::<u32>();

View File

@ -97,7 +97,7 @@ pub extern "C" fn _asctime(time: u32, instance: &mut Instance) -> u32 {
let sec = if date.tm_sec < 10 {":0"} else {":"};
let year = 1900 + date.tm_year;
let mut time_str = format!(
let time_str = format!(
// NOTE: The 14 accompanying chars are needed for some reason
"{} {}{}{}{}{}{}{}{}{} {}\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
days[date.tm_wday as usize],
@ -117,8 +117,9 @@ pub extern "C" fn _asctime(time: u32, instance: &mut Instance) -> u32 {
let time_str_ptr = time_str[0..26].as_ptr() as _;
let time_str_offset = copy_cstr_into_wasm(instance, time_str_ptr);
let c_str = instance.memory_offset_addr(0, time_str_offset as _) as *mut i8;
use std::ffi::CStr;
// let c_str = instance.memory_offset_addr(0, time_str_offset as _) as *mut i8;
// use std::ffi::CStr;
// debug!("#### cstr = {:?}", CStr::from_ptr(c_str));
// std::mem::forget(time_str);
time_str_offset