blob: 427920ea6bc789e380f45135227be65ff05c2473 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use std::ffi::c_void;
use winapi::um::heapapi::{HeapAlloc, HeapFree};
use winapi::um::{heapapi::HeapCreate, winnt::HEAP_NO_SERIALIZE};
pub unsafe fn heap_create() -> *mut c_void {
HeapCreate(HEAP_NO_SERIALIZE, 0, 0)
}
pub unsafe fn heap_alloc(heap: *mut c_void, bytes: usize) -> *mut c_void {
HeapAlloc(heap, 0, bytes)
}
pub unsafe fn heap_free(heap: *mut c_void, alloc: *mut c_void) {
HeapFree(heap, 0, alloc);
}
|