Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jemalloc/jemalloc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: mattsta/jemalloc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: add/cmake-2019
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 14 files changed
  • 1 contributor

Commits on May 30, 2019

  1. Add CMake build infrastructure

    This implements CMake infrastrucutre in preparation for jemalloc 5.2.0
    
    CMake build supports features from configure.ac:
      - automatic symbol extraction (je_ and jet_)
        - auto-generate awk formatting files
        - build all objects with -DJEMALLOC_NO_PRIVATE_NAMESPACE
        - run nm -a against object files and pipe through awk
        - output private header files
      - platform feature detection
        - tests adapted from configure.ac into CMake check_c_source_runs()
      - header generation from .h.in to .h based on config-discovered features
      - 4-way building
        - generate je_ objects with symbols exposed
        - generate je_ objects for building
        - generate jet_ objects with symbols exposed
        - generate jet_ objects for building
      - make test (currently only exposed when CMake release is Debug)
      - C++14 wrapper built and included in library by default
        - this means CMake recognizes libjemalloc.{a,so,dylib} as a C++ library
          and any projects using it will be linked with C++
        - the configure option JEMALLOC_CXX_DISABLE can disable including the
          C++ wrapper which will cause CMake to see jemalloc as a C-only
          library again
      - per-OS feature flags
      - user configuration options (the old ./configure --[opt] settings)
        - many options implemented, but not all yet
          - and the implemented options haven't all been tested either
        - options can be edited after configuration with `make edit_cache`
          - but may require a clean build/ directory because we aren't
            regenerating feature headers on each post-config-config update
    
    Featues unique to this CMake build infrastructure:
      - complete out-of-source builds
        - all headers and supporting artifacts are generated in build/
          - mkdir build; cd build; cmake ..; make -j4
      - no "make distclean" required to remove build cruft
        - just `rm -rf build/` and you have a 100% clean checkout again
      - better build system organization:
        - compiler detection: build-aux/DetectCompilerFeatures.cmake
        - OS detection: build-aux/DetectOSFeatures.cmake
        - exposed config options: build-aux/UserCompileOptions.cmake
    
    Features ignored or not complete right now:
      - installing
      - doc building
      - shell wrapper creation (bin/jemalloc.sh, etc)
      - dual building of pic and non-pic objects/archives
      - windows build support
      - proper library-wide mangle of override functions
      - refactoring the original jemalloc-cmake approach to tests
        - it works currently, but the CMake directives are convoluted in places
    
    History:
    This original CMake conversion started by using CMake files from
    jemalloc/jemalloc-cmake, but (for some reason?) the jemalloc-cmake
    repository is actually a windows-only CMake port. Also, the git
    history there is so outdated and polluted we can't use commits from it
    against the live jemalloc/jemalloc repository.
    
    Those intial CMake conversion scripts were a useful starting point though.
    
    For re-CMaking inspiration, I started with the CMake files from:
    jemalloc/jemalloc-cmake as of
    88c2dc8
    Thu Dec 15 16:26:43 2016 -0800
    
    and fixed it to build on non-windows platforms (while removing some of
    the windows-only operations and other irrelevant behaviors since they
    can't easily be tested (or even run?) on other platforms).
    
    The initial jemalloc-cmake infrastructure had a lot of useful utilities
    for building CMake, translating autoconf includes, and finding system
    properties. I kept most of those in place and they saved much
    trial-and-error shuffling around trying to get output text files
    formatted properly.
    
    If Windows support is desired again, support should be added to this
    CMake deployment revision instead of the abandoned jemalloc/jemalloc-cmake.
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    7afd546 View commit details
    Browse the repository at this point in the history
  2. fixup! Add CMake build infrastructure

    When merging, this commit should be squashed into the previous commit since
    they all form one logical commit: git rebase -i --autosquash origin/dev
    
    This commit contains only fixes to the previous commit.
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    3fa03a2 View commit details
    Browse the repository at this point in the history
  3. fixup! Add CMake build infrastructure

    Multi-purpose bulk commit to rebase into the final merge:
      - greatly improves proper rebuilding of generated files based on when
    their underlying dependencies or assumptions (.git modifications) change
      - improves reliability of private header generation
      - attempted (and failed, but left notes about) moving symbol extraction
    from an one-for-all approach to a one-for-one approach, but CMake is
    fighting us on a clean solution. (the simplest solution at this point
    would be to disable the COMMENT blocks on the custom symbol and header
    generation commands so they don't clutter output and can run whenever
    they need to run)
      - removed some other legacy jemalloc cmake attempts from years ago
      - improved private namespace user config options
      - various refactoring, logic cleanup, and more explicit comments
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    1ff24ed View commit details
    Browse the repository at this point in the history
  4. fixup! Add CMake build infrastructure

    Improve test target names so they don't conflict when being included in
    other projects (generic names like 'stats' and 'zero' have a high chance
    of conflicting with other projects).
    
    Also improves overall test organization (direct names everywhere instead
    of unnecessarily templated variables) plus test creation through
    reusing a function instead of having copy/pasted test creation in five
    directories.
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    5484be3 View commit details
    Browse the repository at this point in the history
  5. fixup! Add CMake build infrastructure

    Adds CMake options to enable/disable STATIC and SHARED libraries as a
    user preference.
    
    Also fixes some dependency logic around awk creation.
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    4130a93 View commit details
    Browse the repository at this point in the history
  6. fixup! Add CMake build infrastructure

    Add new test broken out from unit/mallctl.c into unit/extent_util.c
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    13de138 View commit details
    Browse the repository at this point in the history
  7. fixup! Add CMake build infrastructure

    Cleanup some style issues and a bad copy/paste comment from previously
    splitting out functionality into two files.
    mattsta committed May 30, 2019
    Configuration menu
    Copy the full SHA
    dc3cde5 View commit details
    Browse the repository at this point in the history
Loading