Ralloc fixes and fixes for Redox execution

This commit is contained in:
Jeremy Soller
2018-07-03 19:07:07 -06:00
parent 7e6e1b164c
commit b6b34a7026
12 changed files with 76 additions and 79 deletions
-1
View File
@@ -9,5 +9,4 @@ cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
ralloc = { path = "../../ralloc", default-features = false }
errno = { path = "../errno" }
+1 -2
View File
@@ -3,7 +3,6 @@
extern crate errno;
extern crate platform;
extern crate ralloc;
use core::cmp;
use core::mem;
@@ -192,7 +191,7 @@ pub unsafe extern "C" fn strndup(s1: *const c_char, size: usize) -> *mut c_char
let len = strnlen(s1, size);
// the "+ 1" is to account for the NUL byte
let buffer = ralloc::alloc(len + 1, 1) as *mut c_char;
let buffer = platform::alloc(len + 1, 16, 8) as *mut c_char;
if buffer.is_null() {
platform::errno = ENOMEM as c_int;
} else {