Skip to content
Snippets Groups Projects
  • Jonathan Wakely's avatar
    3c742621
    libstdc++: Prefer to use mmap instead of malloc in libbacktrace · 3c742621
    Jonathan Wakely authored
    As reported in PR libbacktrace/105240, libbacktrace leaks memory when
    using malloc for allocations. I originally thought it would be simpler
    to just use malloc unconditionally (because it's supported on all
    targets) but the leaks make that problematic.
    
    This adds libbacktrace's detection for mmap to the libstdc++
    configury, so that we use mmap.c and mmapio.c when possible. This avoids
    the leaks seen previously, at least on linux.
    
    libstdc++-v3/ChangeLog:
    
    	* acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Check for mmap.
    	* config.h.in: Regenerate.
    	* configure: Regenerate.
    3c742621
    History
    libstdc++: Prefer to use mmap instead of malloc in libbacktrace
    Jonathan Wakely authored
    As reported in PR libbacktrace/105240, libbacktrace leaks memory when
    using malloc for allocations. I originally thought it would be simpler
    to just use malloc unconditionally (because it's supported on all
    targets) but the leaks make that problematic.
    
    This adds libbacktrace's detection for mmap to the libstdc++
    configury, so that we use mmap.c and mmapio.c when possible. This avoids
    the leaks seen previously, at least on linux.
    
    libstdc++-v3/ChangeLog:
    
    	* acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Check for mmap.
    	* config.h.in: Regenerate.
    	* configure: Regenerate.