[cfg(target_arch = "wasm32")]
(size: u32)
| 25 | #[no_mangle] |
| 26 | //#[cfg(target_arch = "wasm32")] |
| 27 | pub unsafe extern "C" fn __alloc_bytes(size: u32) -> i32 { |
| 28 | let layout = Layout::array::<u8>(size as usize).expect("u8 should definitely have a layout"); |
| 29 | let ptr = alloc::alloc(layout) as i32; |
| 30 | |
| 31 | debug_assert_ne!(0, ptr); |
| 32 | // useful for debugging |
| 33 | //println!("allocated {} at {}", size, ptr); |
| 34 | ptr |
| 35 | } |
| 36 | |
| 37 | /// Frees ptr from `memory` in WASM |
| 38 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…