]> Zhao Yanbai Git Server - minix.git/commitdiff
malloc build fixes
authorBen Gras <ben@minix3.org>
Thu, 18 Aug 2011 22:30:51 +0000 (22:30 +0000)
committerBen Gras <ben@minix3.org>
Thu, 18 Aug 2011 22:30:51 +0000 (22:30 +0000)
lib/libc/ansi/malloc-debug.c
lib/nbsd_libc/stdlib/Makefile.inc

index 2a32bbfd45f99c2ec3237fda09086c555911d557..c14717809e7fa338f9980bd45fc2e4bc203f0454 100644 (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;
index 05d8c0a4e9594a55e93a85d2ba46fc6ae40f3560..f1abd7b2f30d46d4a02ec3f7f7c10de5922e7624 100644 (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