Skip to content
  1. Jan 18, 2014
  2. Jan 17, 2014
    • Jason Evans's avatar
      eefdd02e
    • Jason Evans's avatar
      Fix name mangling for stress tests. · f234dc51
      Jason Evans authored
      Fix stress tests such that testlib code uses the jet_ allocator, but
      test code uses libjemalloc.
      
      Generate jemalloc_{rename,mangle}.h, the former because it's needed for
      the stress test name mangling fix, and the latter for consistency.  As
      an artifact of this change, some (but not all) definitions related to
      the experimental API are absent from the headers unless the feature is
      enabled at configure time.
      f234dc51
  3. Jan 16, 2014
    • Jason Evans's avatar
      Refactor prof_dump() to reduce contention. · 4f37ef69
      Jason Evans authored
      Refactor prof_dump() to use a two pass algorithm, and prof_leave() prior
      to the second pass.  This avoids write(2) system calls while holding
      critical prof resources.
      
      Fix prof_dump() to close the dump file descriptor for all relevant error
      paths.
      
      Minimize the size of prof-related static buffers when prof is disabled.
      This saves roughly 65 KiB of application memory for non-prof builds.
      
      Refactor prof_ctx_init() out of prof_lookup_global().
      4f37ef69
  4. Jan 15, 2014
  5. Jan 13, 2014
    • Jason Evans's avatar
      Extract profiling code from [re]allocation functions. · b2c31660
      Jason Evans authored
      Extract profiling code from malloc(), imemalign(), calloc(), realloc(),
      mallocx(), rallocx(), and xallocx().  This slightly reduces the amount
      of code compiled into the fast paths, but the primary benefit is the
      combinatorial complexity reduction.
      
      Simplify iralloc[t]() by creating a separate ixalloc() that handles the
      no-move cases.
      
      Further simplify [mrxn]allocx() (and by implication [mrn]allocm()) to
      make request size overflows due to size class and/or alignment
      constraints trigger undefined behavior (detected by debug-only
      assertions).
      
      Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling
      backtrace creation in imemalign().  This bug impacted posix_memalign()
      and aligned_alloc().
      b2c31660
  6. Jan 08, 2014
  7. Jan 07, 2014
    • Jason Evans's avatar
      Add util unit tests, and fix discovered bugs. · e18c25d2
      Jason Evans authored
      Add unit tests for pow2_ceil(), malloc_strtoumax(), and
      malloc_snprintf().
      
      Fix numerous bugs in malloc_strotumax() error handling/reporting.  These
      bugs could have caused application-visible issues for some seldom used
      (0X... and 0... prefixes) or malformed MALLOC_CONF or mallctl() argument
      strings, but otherwise they had no impact.
      
      Fix numerous bugs in malloc_snprintf().  These bugs were not exercised
      by existing malloc_*printf() calls, so they had no impact.
      e18c25d2
  8. Jan 04, 2014
  9. Jan 03, 2014
    • Jason Evans's avatar
      Convert rtree from (void *) to (uint8_t) storage. · b954bc5d
      Jason Evans authored
      Reduce rtree memory usage by storing booleans (1 byte each) rather than
      pointers.  The rtree code is only used to record whether jemalloc manages
      a chunk of memory, so there's no need to store pointers in the rtree.
      
      Increase rtree node size to 64 KiB in order to reduce tree depth from 13
      to 3 on 64-bit systems.  The conversion to more compact leaf nodes was
      enough by itself to make the rtree depth 1 on 32-bit systems; due to the
      fact that root nodes are smaller than the specified node size if
      possible, the node size change has no impact on 32-bit systems (assuming
      default chunk size).
      b954bc5d
    • Jason Evans's avatar
      Add rtree unit tests. · b980cc77
      Jason Evans authored
      b980cc77
  10. Jan 02, 2014
  11. Dec 21, 2013
  12. Dec 20, 2013
  13. Dec 19, 2013
  14. Dec 18, 2013
    • Jason Evans's avatar
      Add missing prototypes. · 1b75b4e6
      Jason Evans authored
      1b75b4e6
    • Jason Evans's avatar
      Add quarantine unit tests. · 0d6c5d8b
      Jason Evans authored
      Verify that freed regions are quarantined, and that redzone corruption
      is detected.
      
      Introduce a testing idiom for intercepting/replacing internal functions.
      In this case the replaced function is ordinarily a static function, but
      the idiom should work similarly for library-private functions.
      0d6c5d8b
  15. Dec 17, 2013
  16. Dec 16, 2013
  17. Dec 14, 2013
    • Jason Evans's avatar
      Fix name mangling issues. · 34779914
      Jason Evans authored
      Move je_* definitions from jemalloc_macros.h.in to jemalloc_defs.h.in,
      because only the latter is an autoconf header (#undef substitution
      occurs).
      
      Fix unit tests to use automatic mangling, so that e.g. mallocx is
      macro-substituted to becom jet_mallocx.
      34779914
  18. Dec 13, 2013
    • Jason Evans's avatar
      Implement the *allocx() API. · d82a5e6a
      Jason Evans authored
      Implement the *allocx() API, which is a successor to the *allocm() API.
      The *allocx() functions are slightly simpler to use because they have
      fewer parameters, they directly return the results of primary interest,
      and mallocx()/rallocx() avoid the strict aliasing pitfall that
      allocm()/rallocx() share with posix_memalign().  The following code
      violates strict aliasing rules:
      
          foo_t *foo;
          allocm((void **)&foo, NULL, 42, 0);
      
      whereas the following is safe:
      
          foo_t *foo;
          void *p;
          allocm(&p, NULL, 42, 0);
          foo = (foo_t *)p;
      
      mallocx() does not have this problem:
      
          foo_t *foo = (foo_t *)mallocx(42, 0);
      d82a5e6a
    • Jason Evans's avatar
      Fix a strict aliasing violation. · 0ac396a0
      Jason Evans authored
      0ac396a0
    • Jason Evans's avatar
      Fix a malloc_mutex dependency in mtx. · a2be4779
      Jason Evans authored
      a2be4779
    • Jason Evans's avatar
      Fix a strict aliasing violation. · dfecadf4
      Jason Evans authored
      dfecadf4
  19. Dec 12, 2013
  20. Dec 11, 2013
    • Jason Evans's avatar
      Clean up SFMT test. · 19609724
      Jason Evans authored
      Refactor array declarations to remove some dubious casts.
      
      Reduce array size to what is actually used.
      
      Extract magic numbers into cpp macro definitions.
      19609724
  21. Dec 10, 2013
    • Jason Evans's avatar
      Fix inline-related macro issues. · 6edc97db
      Jason Evans authored
      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.
      6edc97db
    • Jason Evans's avatar
      Silence some unused variable warnings. · 73692325
      Jason Evans authored
      73692325