Skip to content
  1. Mar 01, 2017
  2. Feb 28, 2017
    • Jason Evans's avatar
      Fix/enhance THP integration. · d84d2909
      Jason Evans authored
      Detect whether chunks start off as THP-capable by default (according to
      the state of /sys/kernel/mm/transparent_hugepage/enabled), and use this
      as the basis for whether to call pages_nohuge() once per chunk during
      first purge of any of the chunk's page runs.
      
      Add the --disable-thp configure option, as well as the the opt.thp
      mallctl.
      
      This resolves #541.
      d84d2909
    • Jason Evans's avatar
      restructure *CFLAGS configuration. · 766ddcd0
      Jason Evans authored
      Convert CFLAGS to be a concatenation:
      
        CFLAGS := CONFIGURE_CFLAGS SPECIFIED_CFLAGS EXTRA_CFLAGS
      
      This ordering makes it possible to override the flags set by the
      configure script both during and after configuration, with CFLAGS and
      EXTRA_CFLAGS, respectively.
      
      This resolves #619.
      766ddcd0
    • Qi Wang's avatar
      Handle race in stats_arena_bins_print · 7b53fe92
      Qi Wang authored
      When multiple threads calling stats_print, race could happen as we read the
      counters in separate mallctl calls; and the removed assertion could fail when
      other operations happened in between the mallctl calls. For simplicity, output
      "race" in the utilization field in this case.
      
      This resolves #616.
      7b53fe92
    • Jason Evans's avatar
      Fix lg_chunk clamping for config_cache_oblivious. · 7c124830
      Jason Evans authored
      Fix lg_chunk clamping to take into account cache-oblivious large
      allocation.  This regression only resulted in incorrect behavior if
      !config_fill (false unless --disable-fill specified) and
      config_cache_oblivious (true unless --disable-cache-oblivious
      specified).
      
      This regression was introduced by
      8a03cf03 (Implement cache index
      randomization for large allocations.), which was first released in
      4.0.0.
      
      This resolves #555.
      7c124830
  3. Feb 27, 2017
  4. Feb 26, 2017
  5. Feb 23, 2017
    • Jason Evans's avatar
      Relax witness assertions related to prof_gdump(). · 08c24e7c
      Jason Evans authored
      In some cases the prof machinery allocates (in order to modify the
      bt2gctx hash table), and such operations are synchronized via
      bt2gctx_mtx.  Rather than asserting that no locks are held on entry
      into functions that may call prof_gdump(), make the weaker assertion
      that no "core" locks are held.  The prof machinery enqueues dumps
      triggered by prof_gdump() calls when bt2gctx_mtx is held, so this
      weakened assertion avoids false failures in such cases.
      08c24e7c
    • Jason Evans's avatar
      Add witness_assert_depth[_to_rank](). · f56cb9a6
      Jason Evans authored
      This makes it possible to make lock state assertions about precisely
      which locks are held.
      f56cb9a6
    • Jason Evans's avatar
      Enable mutex witnesses even when !isthreaded. · 7034e6ba
      Jason Evans authored
      This fixes interactions with witness_assert_depth[_to_rank](), which was
      added in dad74bd3 (Convert
      witness_assert_lockless() to witness_assert_lock_depth().).
      7034e6ba
    • David Goldblatt's avatar
      CI: Run --enable-debug builds on windows · 44e50041
      David Goldblatt authored
      This will hopefully catch some windows-specific bugs.
      44e50041
    • Jason Evans's avatar
      Use MALLOC_CONF rather than malloc_conf for tests. · e85e588e
      Jason Evans authored
      malloc_conf does not reliably work with MSVC, which complains of
      "inconsistent dll linkage", i.e. its inability to support the
      application overriding malloc_conf when dynamically linking/loading.
      Work around this limitation by adding test harness support for per test
      shell script sourcing, and converting all tests to use MALLOC_CONF
      instead of malloc_conf.
      e85e588e
    • Jason Evans's avatar
      Fix/refactor tcaches synchronization. · 3ecc3c84
      Jason Evans authored
      Synchronize tcaches with tcaches_mtx rather than ctl_mtx.  Add missing
      synchronization for tcache flushing.  This bug was introduced by
      1cb181ed (Implement explicit tcache
      support.), which was first released in 4.0.0.
      3ecc3c84
  6. Feb 22, 2017
  7. Feb 21, 2017
    • David Goldblatt's avatar
      Beef up travis CI integration testing · d4f3f9a0
      David Goldblatt authored
      Introduces gen_travis.py, which generates .travis.yml, and updates .travis.yml
      to be the generated version.
      
      The travis build matrix approach doesn't play well with mixing and matching
      various different environment settings, so we generate every build explicitly,
      rather than letting them do it for us.
      
      To avoid abusing travis resources (and save us time waiting for CI results), we
      don't test every possible combination of options; we only check up to 2 unusual
      settings at a time.
      d4f3f9a0
  8. Jan 25, 2017
  9. Jan 24, 2017
  10. Jan 18, 2017
    • Mike Hommey's avatar
      Add dummy implementations for most remaining OSX zone allocator functions · c6943acb
      Mike Hommey authored
      Some system libraries are using malloc_default_zone() and then using
      some of the malloc_zone_* API. Under normal conditions, those functions
      check the malloc_zone_t/malloc_introspection_t struct for the values
      that are allowed to be NULL, so that a NULL deref doesn't happen.
      
      As of OSX 10.12, malloc_default_zone() doesn't return the actual default
      zone anymore, but returns a fake, wrapper zone. The wrapper zone defines
      all the possible functions in the malloc_zone_t/malloc_introspection_t
      struct (almost), and calls the function from the registered default zone
      (jemalloc in our case) on its own. Without checking whether the pointers
      are NULL.
      
      This means that a system library that calls e.g.
      malloc_zone_batch_malloc(malloc_default_zone(), ...) ends up trying to
      call jemalloc_zone.batch_malloc, which is NULL, and crash follows.
      
      So as of OSX 10.12, the default zone is required to have all the
      functions available (really, the same as the wrapper zone), even if they
      do nothing.
      
      This is arguably a bug in libsystem_malloc in OSX 10.12, but jemalloc
      still needs to work in that case.
      c6943acb
    • Mike Hommey's avatar
      Don't rely on OSX SDK malloc/malloc.h for malloc_zone struct definitions · c68bb417
      Mike Hommey authored
      The SDK jemalloc is built against might be not be the latest for various
      reasons, but the resulting binary ought to work on newer versions of
      OSX.
      
      In order to ensure this, we need the fullest definitions possible, so
      copy what we need from the latest version of malloc/malloc.h available
      on opensource.apple.com.
      c68bb417
  11. Jan 13, 2017
    • John Paul Adrian Glaubitz's avatar
      Use better pre-processor defines for sparc64 · 9389335b
      John Paul Adrian Glaubitz authored
      Currently, jemalloc detects sparc64 targets by checking whether
      __sparc64__ is defined. However, this definition is used on BSD
      targets only. Linux targets define both __sparc__ and __arch64__
      for sparc64. Since this also works on BSD, rather use __sparc__
      and __arch64__ instead of __sparc64__ to detect sparc64 targets.
      9389335b
  12. Dec 04, 2016
  13. Nov 29, 2016
    • John Szakmeister's avatar
      Implement a more reliable detection scheme for os_unfair_lock. · a05d4da4
      John Szakmeister authored
      The core issue here is the weak linking of the symbol, and in certain
      environments--for instance, using the latest Xcode (8.1) with the latest
      SDK (10.12)--os_unfair_lock may resolve even though you're compiling on
      a host that doesn't support it (10.11).
      
      We can use the availability macros to circumvent this problem, and
      detect that we're not compiling for a target that is going to support
      them and error out at compile time.  The other alternative is to do a
      runtime check, but that presents issues for cross-compiling.
      a05d4da4
  14. Nov 24, 2016
    • Jason Evans's avatar
      Mark partially purged arena chunks as non-hugepage. · e98a620c
      Jason Evans authored
      Add the pages_[no]huge() functions, which toggle huge page state via
      madvise(..., MADV_[NO]HUGEPAGE) calls.
      
      The first time a page run is purged from within an arena chunk, call
      pages_nohuge() to tell the kernel to make no further attempts to back
      the chunk with huge pages.  Upon arena chunk deletion, restore the
      associated virtual memory to its original state via pages_huge().
      
      This resolves #243.
      e98a620c
  15. Nov 22, 2016
  16. Nov 18, 2016
    • Jason Evans's avatar
      Add pthread_atfork(3) feature test. · 949a27fc
      Jason Evans authored
      Some versions of Android provide a pthreads library without providing
      pthread_atfork(), so in practice a separate feature test is necessary
      for the latter.
      949a27fc
  17. Nov 17, 2016