Merge branch 'dlmalloc' into 'master'

Replace C dlmalloc

See merge request redox-os/relibc!430
This commit is contained in:
Jeremy Soller
2023-12-12 15:04:17 +00:00
21 changed files with 322 additions and 6417 deletions
+15
View File
@@ -26,6 +26,9 @@ pub const MAP_TYPE: c_int = 0x000F;
pub const MAP_ANON: c_int = 0x0020;
pub const MAP_ANONYMOUS: c_int = MAP_ANON;
pub const MAP_STACK: c_int = 0x20000;
pub const MAP_FAILED: *mut c_void = usize::wrapping_neg(1) as *mut c_void;
pub const MREMAP_MAYMOVE: c_int = 1;
pub const MS_ASYNC: c_int = 0x0001;
pub const MS_INVALIDATE: c_int = 0x0002;
@@ -62,6 +65,18 @@ pub unsafe extern "C" fn mmap(
Sys::mmap(addr, len, prot, flags, fildes, off)
}
#[no_mangle]
unsafe extern "C" fn mremap(
old_address: *mut c_void,
old_size: usize,
new_size: usize,
flags: c_int,
mut args: ...
) -> *mut c_void {
let new_address = args.arg::<*mut c_void>();
Sys::mremap(old_address, old_size, new_size, flags, new_address)
}
#[no_mangle]
pub unsafe extern "C" fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int {
Sys::mprotect(addr, len, prot)