aboutsummaryrefslogtreecommitdiff
path: root/malloc
AgeCommit message (Collapse)AuthorFilesLines
2014-02-11malloc/mtrace.c: Cosmetic cleanup.Will Newton1-31/+10
Remove an unused #define and use ANSI prototypes. Generated code identical on x86_64-unknown-linux-gnu. ChangeLog: 2014-02-11 Will Newton <will.newton@linaro.org> * malloc/mtrace.c (attribute_hidden): Remove unused macro definition. (tr_where, tr_freehook, tr_mallochook, tr_reallochook, tr_memalignhook): Use ANSI protoype.
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka3-23/+23
2014-02-10Remove THREAD_STATS.Ondřej Bílka2-60/+0
A THREAD_STATS macro duplicates gathering information that could be obtained by systemtap probes instead.
2014-01-05Fix gettext call formattingAllan McRae1-1/+1
2014-01-02Reformat malloc to gnu style.Ondřej Bílka17-3754/+4004
2014-01-01Update remaining copyright datesAllan McRae3-3/+3
Update copyright years that are not handled by scripts/update-copyright.
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae30-30/+30
2013-12-24Fix race in free() of fastbin chunk: BZ #15073Maxim Kuvyrkov1-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.
2013-12-10Expand MALLOC_COPY and MALLOC_ZERO to memcpy and memset.Ondřej Bílka2-19/+6
2013-12-10Drop PER_THREAD conditionals from malloc.Ondřej Bílka4-96/+0
2013-12-09Simplify perturb_byte logic.Ondřej Bílka1-21/+24
2013-12-09Replace malloc force_reg by atomic_forced_read.Ondřej Bílka3-17/+10
2013-12-06Fix BZ #15089: malloc_trim always trim for large padding.Fernando J. V. da Silva1-33/+35
2013-11-28Make memset in calloc a tail call.Ondřej Bílka1-2/+2
2013-11-21Add missing #include for malloc/hooks.c code.Roland McGrath1-2/+3
2013-11-21Use __glibc_block in public headers.Meador Inge1-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
2013-11-20Consolidate valloc/pvalloc code.Ondřej Bílka2-109/+33
To make malloc code more maintainable we make malloc and pvalloc share logic with memalign.
2013-11-01Fix malloc_info statistic. Fixes bug 16112Ondřej Bílka1-16/+4
2013-10-30malloc: Fix for infinite loop in memalign/posix_memalign.Will Newton4-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.
2013-10-30Use atomic operations to track memory. Fixes bug 11087Ondřej Bílka1-12/+11
2013-10-30rename configure.in to configure.acMike Frysinger1-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>
2013-10-18Remove assert in malloc statistic. Fixes bug 12486.Ondřej Bílka1-9/+0
2013-10-10malloc/hooks.c: Correct check for overflow in memalign_check.Will Newton1-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.
2013-10-04malloc/tst-valloc.c: Tidy up code.Will Newton1-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.
2013-10-04malloc/tst-pvalloc.c: Tidy up code.Will Newton1-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.
2013-10-04malloc/tst-posix_memalign.c: Tidy up code.Will Newton1-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.
2013-10-04malloc: Add memalign test.Will Newton2-1/+100
ChangeLog: 2013-10-04 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-memalign. * malloc/tst-memalign.c: New file.
2013-10-02malloc: Add pvalloc test.Will Newton2-1/+93
ChangeLog: 2013-10-02 Will Newton <will.newton@linaro.org> * malloc/Makefile: Add tst-pvalloc. * malloc/tst-pvalloc.c: New file.
2013-10-02malloc/tst-valloc.c: Improve test coverage and use test-skeleton.c.Will Newton1-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.
2013-10-02malloc: Add posix_memalign test.Will Newton2-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.
2013-09-20Add malloc probes for sbrk and heap resizing.Alexandre Oliva2-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.
2013-09-20Add catch-all alloc retry probe.Alexandre Oliva1-0/+1
for ChangeLog * malloc/arena.c (arena_get_retry): Add memory_arena_retry probe. * manual/probes.texi: Document it.
2013-09-20Add probes for malloc retries.Alexandre Oliva1-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.
2013-09-20Add probes for malloc arena changes.Alexandre Oliva2-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.
2013-09-20Add probes for all changes to malloc options.Alexandre Oliva1-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.
2013-09-20Add first set of memory probes.Alexandre Oliva2-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.
2013-09-11malloc: Check for integer overflow in memalign.Will Newton1-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.
2013-09-11malloc: Check for integer overflow in valloc.Will Newton1-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.
2013-09-11malloc: Check for integer overflow in pvalloc.Will Newton1-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.
2013-09-09malloc: Add realloc test.Will Newton2-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.
2013-08-29Fix typos.Ondřej Bílka1-1/+1
2013-06-08Use (void) in no-arguments function definitions.Joseph Myers3-5/+5
2013-06-07Avoid use of "register" as optimization hint.Joseph Myers1-13/+13
2013-05-31Link extra-libs consistently with libc and ld.so.Joseph Myers1-1/+1
2013-05-16Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold2-0/+2
2013-05-15Move _obstack_compat out of commonPeter Collingbourne1-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. -
2013-03-18BZ#14812: Add missing translation marker on some argp option argument names ↵Roland McGrath1-4/+7
in utilities.
2013-03-08Remove __malloc_ptr_t.Joseph Myers5-36/+33
2013-03-08Use ISO C prototype for __default_morecore.Joseph Myers1-2/+1
2013-03-08Remove __malloc_ptrdiff_t.Joseph Myers2-4/+1