diff --git a/lib/libc/stdlib/malloc/Makefile.inc b/lib/libc/stdlib/malloc/Makefile.inc --- a/lib/libc/stdlib/malloc/Makefile.inc +++ b/lib/libc/stdlib/malloc/Makefile.inc @@ -1,3 +1,3 @@ SYM_MAPS+=${LIBC_SRCTOP}/stdlib/malloc/Symbol.map -.include "${LIBC_SRCTOP}/stdlib/malloc/jemalloc/Makefile.inc" +.include "${LIBC_SRCTOP}/stdlib/malloc/${OPT_LIBC_MALLOC}/Makefile.inc" diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -228,6 +228,11 @@ LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ VERIEXEC/BEARSSL \ +__SINGLE_OPTIONS = \ + LIBC_MALLOC + +__LIBC_MALLOC_OPTIONS= jemalloc + # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # diff --git a/tools/build/options/LIBC_MALLOC b/tools/build/options/LIBC_MALLOC new file mode 100644 --- /dev/null +++ b/tools/build/options/LIBC_MALLOC @@ -0,0 +1,10 @@ +.It Va LIBC_MALLOC +Specify the +.Xr malloc 3 +implementaiton used by libc. +The default value is +.Li jemalloc . +Valid values are: +.Bl -tag -width indent +.It Li jemalloc +.El