summaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/jemalloc_internal_macros.h
Commit message (Collapse)AuthorAgeFilesLines
* Do not use #pragma GCC diagnostic with gcc < 4.6.Jason Evans2019-03-091-10/+12
| | | | | This regression was introduced by 3d29d11ac2c1583b9959f73c0548545018d31c8a (Clean compilation -Wextra).
* Suppress -Wmissing-field-initializer warning only for compilers with buggy ↵gnzlbg2018-07-101-2/+13
| | | | implementation
* Clean compilation -Wextragnzlbg2018-07-101-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit jemalloc produced many warnings when compiled with -Wextra with both Clang and GCC. This commit fixes the issues raised by these warnings or suppresses them if they were spurious at least for the Clang and GCC versions covered by CI. This commit: * adds `JEMALLOC_DIAGNOSTIC` macros: `JEMALLOC_DIAGNOSTIC_{PUSH,POP}` are used to modify the stack of enabled diagnostics. The `JEMALLOC_DIAGNOSTIC_IGNORE_...` macros are used to ignore a concrete diagnostic. * adds `JEMALLOC_FALLTHROUGH` macro to explicitly state that falling through `case` labels in a `switch` statement is intended * Removes all UNUSED annotations on function parameters. The warning -Wunused-parameter is now disabled globally in `jemalloc_internal_macros.h` for all translation units that include that header. It is never re-enabled since that header cannot be included by users. * locally suppresses some -Wextra diagnostics: * `-Wmissing-field-initializer` is buggy in older Clang and GCC versions, where it does not understanding that, in C, `= {0}` is a common C idiom to initialize a struct to zero * `-Wtype-bounds` is suppressed in a particular situation where a generic macro, used in multiple different places, compares an unsigned integer for smaller than zero, which is always true. * `-Walloc-larger-than-size=` diagnostics warn when an allocation function is called with a size that is too large (out-of-range). These are suppressed in the parts of the tests where `jemalloc` explicitly does this to test that the allocation functions fail properly. * adds a new CI build bot that runs the log unit test on CI. Closes #1196 .
* Logging: allow logging with empty varargs.David Goldblatt2017-07-221-0/+3
| | | | | | Currently, the log macro requires at least one argument after the format string, because of the way the preprocessor handles varargs macros. We can hide some of that irritation by pushing the extra arguments into a varargs function.
* Stop depending on JEMALLOC_N() for function interception during testing.Jason Evans2017-05-121-0/+7
| | | | | | Instead, always define function pointers for interceptable functions, but mark them const unless testing, so that the compiler can optimize out the pointer dereferences.
* Remove --enable-code-coverage.Jason Evans2017-04-241-1/+1
| | | | | | | This option hasn't been particularly useful since the original pre-3.0.0 push to broaden test coverage. This partially resolves #580.
* Remove --disable-cc-silence.Jason Evans2017-04-241-5/+1
| | | | | | | The explicit compiler warning suppression controlled by this option is universally desirable, so remove the ability to disable suppression. This partially resolves #580.
* Get rid of most of the various inline macros.David Goldblatt2017-04-241-29/+5
|
* Make type abbreviations consistent: ssize_t is zd everywhereDavid Goldblatt2017-03-071-4/+4
|
* Stop #define-ining away 'inline'David Goldblatt2017-03-031-1/+0
| | | | | In the long term, we'll transition to C99-style inline semantics. In the short-term, this will allow both styles to coexist without breaking one another.
* Replace tabs following #define with spaces.Jason Evans2017-01-211-8/+8
| | | | This resolves #564.
* Break up headers into constituent partsDavid Goldblatt2017-01-121-0/+5
| | | | | | | | | | This is part of a broader change to make header files better represent the dependencies between one another (see https://github.com/jemalloc/jemalloc/issues/533). It breaks up component headers into smaller parts that can be made to have a simpler dependency graph. For the autogenerated headers (smoothstep.h and size_classes.h), no splitting was necessary, so I didn't add support to emit multiple headers.
* jemalloc cpp new/delete bindingsDave Watson2016-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds cpp bindings for jemalloc, along with necessary autoconf settings. This is mostly to add sized deallocation support, which can't be added from C directly. Sized deallocation is ~10% microbench improvement. * Import ax_cxx_compile_stdcxx.m4 from the autoconf repo, seems like the easiest way to get c++14 detection. * Adds various other changes, like CXXFLAGS, to configure.ac. * Adds new rules to Makefile.in for src/jemalloc-cpp.cpp, and a basic unittest. * Both new and delete are overridden, to ensure jemalloc is used for both. * TODO future enhancement of avoiding extra PLT thunks for new and delete - sdallocx and malloc are publicly exported jemalloc symbols, using an alias would link them directly. Unfortunately, was having trouble getting it to play nice with jemalloc's namespace support. Testing: Tested gcc 4.8, gcc 5, gcc 5.2, clang 4.0. Only gcc >= 5 has sized deallocation support, verified that the rest build correctly. Tested mac osx and Centos. Tested --with-jemalloc-prefix and --without-export. This resolves #202.
* Use KQU() rather than QU() where applicable.Jason Evans2014-05-291-2/+2
| | | | Fix KZI() and KQI() to append LL rather than ULL.
* Add size class computation capability.Jason Evans2014-05-291-0/+6
| | | | | | | Add size class computation capability, currently used only as validation of the size class lookup tables. Generalize the size class spacing used for bins, for eventual use throughout the full range of allocation sizes.
* Move platform headers and tricks from jemalloc_internal.h.in to a new ↵Mike Hommey2014-05-281-4/+0
| | | | jemalloc_internal_decls.h header
* Move __func__ to jemalloc_internal_macros.hMike Hommey2014-05-271-0/+4
| | | | test/integration/aligned_alloc.c needs it.
* Add workaround for missing 'restrict' keyword.Jason Evans2014-02-251-0/+4
| | | | | | | | | Add a cpp #define that removes 'restrict' keyword usage unless the compiler definitely supports C99. As written, 'restrict' is only enabled if the compiler supports the -std=gnu99 option (e.g. gcc and llvm). Reported by Tobias Hieta.
* Fix inline-related macro issues.Jason Evans2013-12-101-8/+10
| | | | | | | | | Add JEMALLOC_INLINE_C and use it instead of JEMALLOC_INLINE in .c files, so that the annotated functions are always static. Remove SFMT's inline-related macros and use jemalloc's instead, so that there's no danger of interactions with jemalloc's definitions that disable inlining for debug builds.
* Add probabability distribution utility code.Jason Evans2013-12-101-0/+1
| | | | | | | | | | | | | | | Add probabability distribution utility code that enables generation of random deviates drawn from normal, Chi-square, and Gamma distributions. Fix format strings in several of the assert_* macros (remove a %s). Clean up header issues; it's critical that system headers are not included after internal definitions potentially do things like: #define inline Fix the build system to incorporate header dependencies for the test library C files.
* Add test code coverage analysis.Jason Evans2013-12-071-2/+2
| | | | Add test code coverage analysis based on gcov.
* Fix more test refactoring issues.Jason Evans2013-12-061-0/+44