Date: Fri, 1 Sep 2023 18:13:21 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: Brooks Davis <brooks@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: 09e32b2fddf5 - main - libc: add LIBC_MALLOC option Message-ID: <8D44A65D-373D-49E5-96D0-208F77C5A402@freebsd.org> In-Reply-To: <202309011654.381Gsuaf070723@gitrepo.freebsd.org> References: <202309011654.381Gsuaf070723@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1 Sep 2023, at 17:54, Brooks Davis <brooks@FreeBSD.org> wrote: >=20 > The branch main has been updated by brooks: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D09e32b2fddf5f673f76e2fffa415a73d= 99a6f309 >=20 > commit 09e32b2fddf5f673f76e2fffa415a73d99a6f309 > Author: Brooks Davis <brooks@FreeBSD.org> > AuthorDate: 2023-09-01 16:42:39 +0000 > Commit: Brooks Davis <brooks@FreeBSD.org> > CommitDate: 2023-09-01 16:54:23 +0000 >=20 > libc: add LIBC_MALLOC option >=20 > This will enable alternative mallocs to be included in the tree and > selected by setting LIBC_MALLOC. As there is only one today = (jemalloc) > this option does nothing, but we expect to add other = implementations > in the future. This will also reduce diffs to CheriBSD. >=20 > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D41660 > --- > lib/libc/stdlib/malloc/Makefile.inc | 2 +- > share/mk/src.opts.mk | 6 ++++++ > tools/build/options/LIBC_MALLOC | 13 +++++++++++++ > 3 files changed, 20 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/libc/stdlib/malloc/Makefile.inc = b/lib/libc/stdlib/malloc/Makefile.inc > index bce4353fe80a..3bae4ff1505b 100644 > --- a/lib/libc/stdlib/malloc/Makefile.inc > +++ b/lib/libc/stdlib/malloc/Makefile.inc > @@ -1,3 +1,3 @@ > SYM_MAPS+=3D${LIBC_SRCTOP}/stdlib/malloc/Symbol.map >=20 > -.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 > index 1183a8202168..d7112cf57178 100644 > --- a/share/mk/src.opts.mk > +++ b/share/mk/src.opts.mk > @@ -228,6 +228,12 @@ __DEFAULT_DEPENDENT_OPTIONS=3D \ > LOADER_VERIEXEC_VECTX/LOADER_VERIEXEC \ > VERIEXEC/BEARSSL \ >=20 > +__SINGLE_OPTIONS =3D \ > + LIBC_MALLOC > + > +__LIBC_MALLOC_OPTIONS=3D jemalloc > +__LIBC_MALLOC_DEFAULT=3D 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 > index 000000000000..ee1883f3ee54 > --- /dev/null > +++ b/tools/build/options/LIBC_MALLOC > @@ -0,0 +1,13 @@ > +Specify the > +.Xr malloc 3 > +implementaiton used by libc. s/implementaiton/implementation/ Jess > +The default value is > +.Li jemalloc . > +Valid values are: > +.Bl -tag -width indent > +.It Li jemalloc > +.El > +.Pp > +Other implementations are expected in the future in both > +.Fx > +and downstream consumers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8D44A65D-373D-49E5-96D0-208F77C5A402>