MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / large_virtual_allocation

Function large_virtual_allocation

cranelift/jit/src/memory/arena.rs:269–279  ·  view source on GitHub ↗

Windows: See https://github.com/darfink/region-rs/pull/34

()

Source from the content-addressed store, hash-verified

267 #[cfg(all(target_pointer_width = "64", not(target_os = "windows")))]
268 // Windows: See https://github.com/darfink/region-rs/pull/34
269 fn large_virtual_allocation() {
270 // We should be able to request 1TB of virtual address space on 64-bit
271 // platforms. Physical memory should be committed as we go.
272 let reserve_size = 1 << 40;
273 let mut arena = ArenaMemoryProvider::new_with_size(reserve_size).unwrap();
274 let ptr = arena.allocate(1, 1, JITMemoryKind::Writable).unwrap();
275 assert_eq!(ptr.addr(), arena.ptr.addr());
276 arena.finalize(BranchProtection::None);
277 unsafe { ptr.write_volatile(42) };
278 unsafe { arena.free_memory() };
279 }
280
281 #[test]
282 fn over_capacity() {

Callers

nothing calls this directly

Calls 4

unwrapMethod · 0.45
allocateMethod · 0.45
finalizeMethod · 0.45
free_memoryMethod · 0.45

Tested by

no test coverage detected