From 4e6f1e920814eafb4ca165a861e9c886022b35e3 Mon Sep 17 00:00:00 2001 From: Kevin Svetlitski Date: Mon, 15 May 2023 10:39:15 -0700 Subject: [PATCH] Allow overriding `LG_PAGE` This is useful for our internal builds where we override the configuration in the header files generated by autoconf. --- .../internal/jemalloc_internal_defs.h.in | 2 ++ .../internal/jemalloc_internal_overrides.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 include/jemalloc/internal/jemalloc_internal_overrides.h diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h.in b/include/jemalloc/internal/jemalloc_internal_defs.h.in index e61667a6..20355949 100644 --- a/include/jemalloc/internal/jemalloc_internal_defs.h.in +++ b/include/jemalloc/internal/jemalloc_internal_defs.h.in @@ -452,4 +452,6 @@ */ #undef JEMALLOC_HAVE_RDTSCP +#include "jemalloc_internal_overrides.h" + #endif /* JEMALLOC_INTERNAL_DEFS_H_ */ diff --git a/include/jemalloc/internal/jemalloc_internal_overrides.h b/include/jemalloc/internal/jemalloc_internal_overrides.h new file mode 100644 index 00000000..ddd6ee17 --- /dev/null +++ b/include/jemalloc/internal/jemalloc_internal_overrides.h @@ -0,0 +1,16 @@ +#ifndef JEMALLOC_INTERNAL_OVERRIDES_H +#define JEMALLOC_INTERNAL_OVERRIDES_H + +/* + * Under normal circumstances this header serves no purpose, as these settings + * can be customized via the corresponding autoconf options at configure-time. + * Overriding in this fashion is useful when the header files generated by + * autoconf are used as input for another build system. + */ + +#ifdef JEMALLOC_OVERRIDE_LG_PAGE + #undef LG_PAGE + #define LG_PAGE JEMALLOC_OVERRIDE_LG_PAGE +#endif + +#endif /* JEMALLOC_INTERNAL_OVERRIDES_H */