about summary refs log tree commit diff
path: root/malloc
Commit message (Collapse)AuthorAgeFilesLines
* Update remaining copyright datesAllan McRae2014-01-013-3/+3
| | | | Update copyright years that are not handled by scripts/update-copyright.
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-0130-30/+30
|
* Fix race in free() of fastbin chunk: BZ #15073Maxim Kuvyrkov2013-12-241-8/+12
| | | | | | | | | | | | Perform sanity check only if we have_lock. Due to lockless nature of fastbins we need to be careful derefencing pointers to fastbin entries (chunksize(old) in this case) in multithreaded environments. The fix is to add have_lock to the if-condition checks. The rest of the patch only makes code more readable. * malloc/malloc.c (_int_free): Perform sanity check only if we have_lock.
* Expand MALLOC_COPY and MALLOC_ZERO to memcpy and memset.Ondřej Bílka2013-12-102-19/+6
|
* Drop PER_THREAD conditionals from malloc.Ondřej Bílka2013-12-104-96/+0
|
* Simplify perturb_byte logic.Ondřej Bílka2013-12-091-21/+24
|
* Replace malloc force_reg by atomic_forced_read.Ondřej Bílka2013-12-093-17/+10
|
* Fix BZ #15089: malloc_trim always trim for large padding.Fernando J. V. da Silva2013-12-061-33/+35
|
* Make memset in calloc a tail call.Ondřej Bílka2013-11-281-2/+2
|
* Add missing #include for malloc/hooks.c code.Roland McGrath2013-11-211-2/+3
|
* Use __glibc_block in public headers.Meador Inge2013-11-211-1/+1
| | | | | | | | | | | | As detailed in PR11157, the use of '__block' is known to interfere with keywords in some environments, such as the Clang -fblocks extension. Recently a similar issue was raised concerning the use of '__unused' and a '__glibc' prefix was proposed to create a glibc implementation namespace for these sorts of issues [1]. This patches takes that approach. [1] https://sourceware.org/ml/libc-alpha/2012-02/msg00047.html [2] http://lists.debian.org/debian-glibc/2013/11/msg00020.html
* Consolidate valloc/pvalloc code.Ondřej Bílka2013-11-202-109/+33
| | | | | To make malloc code more maintainable we make malloc and pvalloc share logic with memalign.
* Fix malloc_info statistic. Fixes bug 16112Ondřej Bílka2013-11-011-16/+4
|
* malloc: Fix for infinite loop in memalign/posix_memalign.Will Newton2013-10-304-0/+41
| | | | | | | | | | | | | | | | | | | A very large alignment argument passed to mealign/posix_memalign causes _int_memalign to enter an infinite loop. Limit the maximum alignment value to the maximum representable power of two to prevent this from happening. Changelog: 2013-10-30 Will Newton <will.newton@linaro.org> [BZ #16038] * malloc/hooks.c (memalign_check): Limit alignment to the maximum representable power of two. * malloc/malloc.c (__libc_memalign): Likewise. * malloc/tst-memalign.c (do_test): Add test for very large alignment values. * malloc/tst-posix_memalign.c (do_test): Likewise.
* Use atomic operations to track memory. Fixes bug 11087Ondřej Bílka2013-10-301-12/+11
|
* rename configure.in to configure.acMike Frysinger2013-10-301-1/+1
| | | | | | | Autoconf has been deprecating configure.in for quite a long time. Rename all our configure.in and preconfigure.in files to .ac. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Remove assert in malloc statistic. Fixes bug 12486.Ondřej Bílka2013-10-181-9/+0
|
* malloc/hooks.c: Correct check for overflow in memalign_check.Will Newton2013-10-101-4/+7
| | | | | | | | | | | | | A large value of bytes passed to memalign_check can cause an integer overflow in _int_memalign and heap corruption. This issue can be exposed by running tst-memalign with MALLOC_CHECK_=3. ChangeLog: 2013-10-10 Will Newton <will.newton@linaro.org> * malloc/hooks.c (memalign_check): Ensure the value of bytes passed to _int_memalign does not overflow.
* malloc/tst-valloc.c: Tidy up code.Will Newton2013-10-041-6/+14
| | | | | | | | | | | | | | Add some comments and call free on all potentially allocated pointers. Also remove duplicate check for NULL pointer. ChangeLog: 2013-10-04 Will Newton <will.newton@linaro.org> * malloc/tst-valloc.c: Add comments. (do_test): Add comments and call free on all potentially allocated pointers. Remove duplicate check for NULL pointer. Add space after cast.
* malloc/tst-pvalloc.c: Tidy up code.Will Newton2013-10-041-6/+14
| | | | | | | | | | | | | | Add some comments and call free on all potentially allocated pointers. Also remove duplicate check for NULL pointer. ChangeLog: 2013-10-04 Will Newton <will.newton@linaro.org> * malloc/tst-pvalloc.c: Add comments. (do_test): Add comments and call free on all potentially allocated pointers. Remove duplicate check for NULL pointer. Add space after cast.
* malloc/tst-posix_memalign.c: Tidy up code.Will Newton2013-10-041-4/+14
| | | | | | | | | | | | Add some comments and call free on all potentially allocated pointers. ChangeLog: 2013-10-04 Will Newton <will.newton@linaro.org> * malloc/tst-posix_memalign.c: Add comments. (do_test): Add comments and call free on all potentially allocated pointers. Add space after cast.
* malloc: Add memalign test.Will Newton2013-10-042-1/+100
| | | | | | | | | ChangeLog: 2013-10-04 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-memalign. * malloc/tst-memalign.c: New file.
* malloc: Add pvalloc test.Will Newton2013-10-022-1/+93
| | | | | | | | | ChangeLog: 2013-10-02 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-pvalloc. * malloc/tst-pvalloc.c: New file.
* malloc/tst-valloc.c: Improve test coverage and use test-skeleton.c.Will Newton2013-10-021-16/+84
| | | | | | | | | ChangeLog: 2013-10-02 Will Newton <will.newton@linaro.org> * malloc/tst-valloc.c: Rewrite to use test-skeleton.c and improve test coverage.
* malloc: Add posix_memalign test.Will Newton2013-10-022-1/+99
| | | | | | | | | ChangeLog: 2013-10-02 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-posix_memalign. * malloc/tst-posix_memalign.c: New file.
* Add malloc probes for sbrk and heap resizing.Alexandre Oliva2013-09-202-1/+9
| | | | | | | | | | | | for ChangeLog * malloc/arena.c (new_heap): New memory_heap_new probe. (grow_heap): New memory_heap_more probe. (shrink_heap): New memory_heap_less probe. (heap_trim): New memory_heap_free probe. * malloc/malloc.c (sysmalloc): New memory_sbrk_more probe. (systrim): New memory_sbrk_less probe. * manual/probes.texi: Document them.
* Add catch-all alloc retry probe.Alexandre Oliva2013-09-201-0/+1
| | | | | | | for ChangeLog * malloc/arena.c (arena_get_retry): Add memory_arena_retry probe. * manual/probes.texi: Document it.
* Add probes for malloc retries.Alexandre Oliva2013-09-201-0/+6
| | | | | | | | | | | | for ChangeLog * malloc/malloc.c (__libc_malloc): Add memory_malloc_retry probe. (__libc_realloc): Add memory_realloc_retry probe. (__libc_memalign): Add memory_memalign_retry probe. (__libc_valloc): Add memory_valloc_retry probe. (__libc_pvalloc): Add memory_pvalloc_retry probe. (__libc_calloc): Add memory_calloc_retry probe. * manual/probes.texi: Document them.
* Add probes for malloc arena changes.Alexandre Oliva2013-09-202-0/+6
| | | | | | | | | | | | | for ChangeLog * malloc/arena.c (get_free_list): Add probe memory_arena_reuse_free_list. (reused_arena) [PER_THREAD]: Add probes memory_arena_reuse_wait and memory_arena_reuse. (arena_get2) [!PER_THREAD]: Likewise. * malloc/malloc.c (__libc_realloc) [!PER_THREAD]: Add probe memory_arena_reuse_realloc. * manual/probes.texi: Document them.
* Add probes for all changes to malloc options.Alexandre Oliva2013-09-201-5/+25
| | | | | | | | | for ChangeLog * malloc/malloc.c (__libc_free): Add memory_mallopt_free_dyn_thresholds probe. (__libc_mallopt): Add multiple memory_mallopt probes. * manual/probes.texi: Document them.
* Add first set of memory probes.Alexandre Oliva2013-09-202-0/+5
| | | | | | | | | | | for ChangeLog * malloc/malloc.c: Include stap-probe.h. (__libc_mallopt): Add memory_mallopt probe. * malloc/arena.c (_int_new_arena): Add memory_arena_new probe. * manual/probes.texi: New. * manual/Makefile (chapters): Add probes. * manual/threads.texi: Set next node.
* malloc: Check for integer overflow in memalign.Will Newton2013-09-111-0/+7
| | | | | | | | | | | | | | A large bytes parameter to memalign could cause an integer overflow and corrupt allocator internals. Check the overflow does not occur before continuing with the allocation. ChangeLog: 2013-09-11 Will Newton <will.newton@linaro.org> [BZ #15857] * malloc/malloc.c (__libc_memalign): Check the value of bytes does not overflow.
* malloc: Check for integer overflow in valloc.Will Newton2013-09-111-0/+7
| | | | | | | | | | | | | | A large bytes parameter to valloc could cause an integer overflow and corrupt allocator internals. Check the overflow does not occur before continuing with the allocation. ChangeLog: 2013-09-11 Will Newton <will.newton@linaro.org> [BZ #15856] * malloc/malloc.c (__libc_valloc): Check the value of bytes does not overflow.
* malloc: Check for integer overflow in pvalloc.Will Newton2013-09-111-0/+7
| | | | | | | | | | | | | | A large bytes parameter to pvalloc could cause an integer overflow and corrupt allocator internals. Check the overflow does not occur before continuing with the allocation. ChangeLog: 2013-09-11 Will Newton <will.newton@linaro.org> [BZ #15855] * malloc/malloc.c (__libc_pvalloc): Check the value of bytes does not overflow.
* malloc: Add realloc test.Will Newton2013-09-092-1/+148
| | | | | | | | | | | | | The current tests don't test the functionality of realloc in detail. Add a new test for realloc that exercises some of the corner cases that are not otherwise tested. ChangeLog: 2013-09-09 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-realloc to tests. * malloc/tst-realloc.c: New file.
* Fix typos.Ondřej Bílka2013-08-291-1/+1
|
* Use (void) in no-arguments function definitions.Joseph Myers2013-06-083-5/+5
|
* Avoid use of "register" as optimization hint.Joseph Myers2013-06-071-13/+13
|
* Link extra-libs consistently with libc and ld.so.Joseph Myers2013-05-311-1/+1
|
* Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold2013-05-162-0/+2
|
* Move _obstack_compat out of commonPeter Collingbourne2013-05-151-1/+1
| | | | | | | | | | | | | it is impossible to create an alias of a common symbol (as compat_symbol does), because common symbols do not have a section or an offset until linked. GNU as tolerates aliases of common symbols by simply creating another common symbol, but other assemblers (notably LLVM's integrated assembler) are less tolerant. 2013-05-15 Peter Collingbourne <pcc@google.com> * malloc/obstack.c (_obstack_compat): Add initializer. -
* BZ#14812: Add missing translation marker on some argp option argument names ↵Roland McGrath2013-03-181-4/+7
| | | | in utilities.
* Remove __malloc_ptr_t.Joseph Myers2013-03-085-36/+33
|
* Use ISO C prototype for __default_morecore.Joseph Myers2013-03-081-2/+1
|
* Remove __malloc_ptrdiff_t.Joseph Myers2013-03-082-4/+1
|
* Remove __malloc_size_t.Joseph Myers2013-03-083-23/+20
|
* Fix FPE in memusagestat when malloc utilization is zeroSiddhesh Poyarekar2013-02-261-37/+60
| | | | | | | [BZ #15160] Draw graphs for heap and stack only if MAXSIZE_HEAP and MAXSIZE_STACK are non-zero.
* Add HAVE_MREMAP for mremap usagePino Toscano2013-01-172-11/+4
| | | | | | | | | Introduce (only on Linux) and use a HAVE_MREMAP symbol to advertize mremap availability. Move the malloc-sysdep.h include from arena.c to malloc.c, since what is provided by malloc-sysdep.h is needed earlier in malloc.c, before the inclusion of arena.c.
* Add --enable-hardcoded-path-in-tests configure optionH.J. Lu2013-01-112-3/+3
|
* Clean up __MALLOC_* macros.Joseph Myers2013-01-072-36/+16
|