mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
27 lines
568 B
Rust
27 lines
568 B
Rust
use core::ffi::c_void;
|
|
|
|
/// # Safety
|
|
/// The Roc application needs this.
|
|
#[no_mangle]
|
|
pub unsafe fn roc_alloc(size: usize, _alignment: u32) -> *mut c_void {
|
|
libc::malloc(size)
|
|
}
|
|
|
|
/// # Safety
|
|
/// The Roc application needs this.
|
|
#[no_mangle]
|
|
pub unsafe fn roc_realloc(
|
|
c_ptr: *mut c_void,
|
|
new_size: usize,
|
|
_old_size: usize,
|
|
_alignment: u32,
|
|
) -> *mut c_void {
|
|
libc::realloc(c_ptr, new_size)
|
|
}
|
|
|
|
/// # Safety
|
|
/// The Roc application needs this.
|
|
#[no_mangle]
|
|
pub unsafe fn roc_dealloc(c_ptr: *mut c_void, _alignment: u32) {
|
|
libc::free(c_ptr)
|
|
}
|