libc: regoranize malloc build

Create a stdlib/malloc to hold the definition of the malloc interface
(e.g., the Symbol.map file) and make jemalloc a subdirectory.  This will
make it easier to integrate alternative allocators such as snmalloc
while making it clear that the current jemalloc symbols are the FreeBSD
API/ABI (for better or worse).

Suggested by:	jrtc27
Reviewed by:	jrtc27, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D41457
This commit is contained in:
Brooks Davis
2023-08-16 19:16:51 +01:00
parent 075c716558
commit c5f49ece16
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ C99_Exit.c: ${LIBC_SRCTOP}/stdlib/_Exit.c .NOMETA
SYM_MAPS+= ${LIBC_SRCTOP}/stdlib/Symbol.map
.include "${LIBC_SRCTOP}/stdlib/jemalloc/Makefile.inc"
.include "${LIBC_SRCTOP}/stdlib/malloc/Makefile.inc"
# machine-dependent stdlib sources
.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib/Makefile.inc"
+3
View File
@@ -0,0 +1,3 @@
SYM_MAPS+=${LIBC_SRCTOP}/stdlib/malloc/Symbol.map
.include "${LIBC_SRCTOP}/stdlib/malloc/jemalloc/Makefile.inc"
@@ -4,8 +4,6 @@ JEMALLOCSRCS:= jemalloc.c arena.c background_thread.c base.c bin.c bitmap.c \
prng.c prof.c rtree.c safety_check.c sc.c stats.c sz.c tcache.c \
test_hooks.c ticker.c tsd.c witness.c
SYM_MAPS+=${LIBC_SRCTOP}/stdlib/jemalloc/Symbol.map
CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include
.for src in ${JEMALLOCSRCS}