Skip to content
  1. Feb 26, 2014
  2. Feb 25, 2014
    • Jason Evans's avatar
      Fix junk filling for mremap(2)-based huge reallocation. · 940fdfd5
      Jason Evans authored
      If mremap(2) is used for huge reallocation, physical pages are mapped to
      new virtual addresses rather than data being copied to new pages.  This
      bypasses the normal junk filling that would happen during allocation, so
      add junk filling that is specific to this case.
      940fdfd5
    • Jason Evans's avatar
      Add configure test to verify SSE2 code compiles. · cb657e31
      Jason Evans authored
      Make sure that emmintrin.h can be #include'd without causing a
      compilation error, rather than blindly defining HAVE_SSE2 based on
      architecture.  Attempts to force SSE2 compilation on a 32-bit Ubuntu
      13.10 system running as a VMware guest resulted in a no-win choice
      without any obvious explanation besides toolchain misconfiguration/bug:
      - Suffer compilation failure due to __MMX__, __SSE__, and __SSE2__ not
        being defined, even if -mmmx, -msse, and -msse2 are manually
        specified (note that they appear to be enabled by default).
      - Manually define __MMX__, __SSE__, and __SSE2__, and suffer compiler
        warnings that they are already automatically defined.  This results in
        successful compilation and execution, but the noise is intolerable.
      cb657e31
    • Jason Evans's avatar
      Break prof_accum into multiple compilation units. · ad47e899
      Jason Evans authored
      Break prof_accum into multiple compilation units, in order to thwart
      compiler optimizations such as inlining and tail call optimization that
      would alter backtraces.
      ad47e899
    • Jason Evans's avatar
      Add workaround for missing 'restrict' keyword. · 99b0fbbe
      Jason Evans authored
      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.
      99b0fbbe
  3. Feb 14, 2014
  4. Feb 13, 2014
  5. Jan 29, 2014
  6. Jan 22, 2014
  7. Jan 21, 2014
  8. Jan 18, 2014
  9. 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
  10. 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
  11. Jan 15, 2014
  12. 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
  13. Jan 08, 2014
  14. 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
  15. Jan 04, 2014
  16. 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
  17. Jan 02, 2014