Call malloc, memalign, memset from exports instead of emscripten_data

This commit is contained in:
Brandon Fish
2019-01-02 20:50:13 -06:00
parent a5bafebc83
commit 68cb6aaf8c
6 changed files with 57 additions and 24 deletions

View File

@ -1,10 +1,11 @@
use super::process::_abort;
use crate::apis::emscripten::env;
use crate::webassembly::Instance;
/// emscripten: ___cxa_allocate_exception
pub extern "C" fn ___cxa_allocate_exception(size: u32, instance: &mut Instance) -> u32 {
debug!("emscripten::___cxa_allocate_exception");
(instance.emscripten_data().as_ref().unwrap().malloc)(size as _, instance)
env::call_malloc(size as _, instance)
}
/// emscripten: ___cxa_throw