malloc build fixes
This commit is contained in:
parent
e81a0fd9c1
commit
195190912f
2 changed files with 7 additions and 3 deletions
|
@ -126,7 +126,11 @@ static struct block *block_alloc(size_t size)
|
||||||
assert(ptr_min < ptr_max);
|
assert(ptr_min < ptr_max);
|
||||||
|
|
||||||
/* select address at random */
|
/* select address at random */
|
||||||
|
#ifdef __NBSD_LIBC
|
||||||
|
tsc = 0;
|
||||||
|
#else
|
||||||
read_tsc_64(&tsc);
|
read_tsc_64(&tsc);
|
||||||
|
#endif
|
||||||
totalsize = block_get_totalsize(size);
|
totalsize = block_get_totalsize(size);
|
||||||
page_index_max = (ptr_max - ptr_min - totalsize) / PAGE_SIZE;
|
page_index_max = (ptr_max - ptr_min - totalsize) / PAGE_SIZE;
|
||||||
page_index = (page_index_max > 0) ? (ex64lo(tsc) % page_index_max) : 0;
|
page_index = (page_index_max > 0) ? (ex64lo(tsc) % page_index_max) : 0;
|
||||||
|
|
|
@ -44,9 +44,9 @@ SRCS+= erand48_ieee754.c
|
||||||
SRCS+= jemalloc.c
|
SRCS+= jemalloc.c
|
||||||
.elif (${USE_MINIXMALLOC} != "no")
|
.elif (${USE_MINIXMALLOC} != "no")
|
||||||
SRCS+= \
|
SRCS+= \
|
||||||
${LIBCDIR}/../libc/stdlib/malloc.c \
|
${LIBCDIR}/../libc/ansi/malloc.c \
|
||||||
${LIBCDIR}/../libc/stdlib/calloc.c \
|
${LIBCDIR}/../libc/ansi/calloc.c \
|
||||||
${LIBCDIR}/../libc/stdlib/malloc-debug.c
|
${LIBCDIR}/../libc/ansi/malloc-debug.c
|
||||||
.else
|
.else
|
||||||
SRCS+= malloc.c
|
SRCS+= malloc.c
|
||||||
.endif
|
.endif
|
||||||
|
|
Loading…
Reference in a new issue