diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-17 00:58:39 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-17 00:58:39 +0200 |
commit | 69ed661a488c0e02bf5fee3dc21e6a31a99a8d85 (patch) | |
tree | d4172bd2932f8b163b58651dd2f1e14f535304c0 /src/malloc.c | |
parent | m fixes (diff) | |
download | slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.gz slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.bz2 slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.xz |
fix errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/malloc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c index 6219fce..528c49f 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -18,9 +18,16 @@ #include <stdlib.h> #include <slibc-alloc.h> #include <strings.h> -#include <sys/mman.h> +/* TODO #include <sys/mman.h> */ #include <unistd.h> #include <errno.h> +/* TODO temporary constants from other headers { */ +#define PROT_READ 0 +#define PROT_WRITE 0 +#define MAP_PRIVATE 0 +#define MAP_ANONYMOUS 0 +#define _SC_PAGESIZE 0 +/* } */ @@ -203,7 +210,8 @@ void* memalign(size_t boundary, size_t size) size_t address; size_t shift = 0; - if (!boundary || (__builtin_ffsl(boundary) != boundary)) + if (!boundary || (__builtin_ffsl((long int)boundary) != boundary)) + /* `size_t` mat not be wider than `long int`. */ return errno = EINVAL, NULL; if (__builtin_uaddl_overflow(boundary - 1, size, &full_size)) return errno = ENOMEM, NULL; |