malloc build fixes

This commit is contained in:
Ben Gras 2011-08-18 22:30:51 +00:00
parent e81a0fd9c1
commit 195190912f
2 changed files with 7 additions and 3 deletions

View file

@ -126,7 +126,11 @@ static struct block *block_alloc(size_t size)
assert(ptr_min < ptr_max);
/* select address at random */
#ifdef __NBSD_LIBC
tsc = 0;
#else
read_tsc_64(&tsc);
#endif
totalsize = block_get_totalsize(size);
page_index_max = (ptr_max - ptr_min - totalsize) / PAGE_SIZE;
page_index = (page_index_max > 0) ? (ex64lo(tsc) % page_index_max) : 0;

View file

@ -44,9 +44,9 @@ SRCS+= erand48_ieee754.c
SRCS+= jemalloc.c
.elif (${USE_MINIXMALLOC} != "no")
SRCS+= \
${LIBCDIR}/../libc/stdlib/malloc.c \
${LIBCDIR}/../libc/stdlib/calloc.c \
${LIBCDIR}/../libc/stdlib/malloc-debug.c
${LIBCDIR}/../libc/ansi/malloc.c \
${LIBCDIR}/../libc/ansi/calloc.c \
${LIBCDIR}/../libc/ansi/malloc-debug.c
.else
SRCS+= malloc.c
.endif