mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 14:41:42 +03:00
Add JEMALLOC_COLD, and mark some functions cold.
This hints to the compiler that it should care more about space than CPU (among other things). In cases where the compiler lacks profile-guided information, this can be a substantial space savings. For now, we mark the mallctl or atexit driven profiling and stats functions that take up the most space.
This commit is contained in:
parent
5d8e70ab26
commit
a9fa2defdb
7 changed files with 36 additions and 1 deletions
12
configure.ac
12
configure.ac
|
|
@ -914,6 +914,18 @@ if test "x${je_cv_fallthrough}" = "xyes" ; then
|
|||
JE_CXXFLAGS_ADD([-Wimplicit-fallthrough])
|
||||
fi
|
||||
|
||||
dnl Check for cold attribute support.
|
||||
JE_CFLAGS_SAVE()
|
||||
JE_CFLAGS_ADD([-Werror])
|
||||
JE_CFLAGS_ADD([-herror_on_warning])
|
||||
JE_COMPILABLE([cold attribute], [],
|
||||
[__attribute__((__cold__)) void foo();],
|
||||
[je_cv_cold])
|
||||
JE_CFLAGS_RESTORE()
|
||||
if test "x${je_cv_cold}" = "xyes" ; then
|
||||
AC_DEFINE([JEMALLOC_HAVE_ATTR_COLD], [ ])
|
||||
fi
|
||||
|
||||
dnl Support optional additions to rpath.
|
||||
AC_ARG_WITH([rpath],
|
||||
[AS_HELP_STRING([--with-rpath=<rpath>], [Colon-separated rpath (ELF systems only)])],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue