| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
A THREAD_STATS macro duplicates gathering information that could be
obtained by systemtap probes instead.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
To make malloc code more maintainable we make malloc and pvalloc share
logic with memalign.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Break the fallback code to try another arena into a separate function
for readability.
|
| |
|
|
|
|
|
| |
* malloc/malloc.c (__libc_mallopt) <M_MMAP_THRESHOLD>: Do not
change internal state upon failure.
|
|
|
|
|
|
|
|
|
|
|
| |
[BZ #1349]
malloc_usable_size returns the usable size in an allocated chunk,
which may be >= the requested size. In the case of MALLOC_CHECK_ being
exported to > 0 however, only the requested size is usable, since a
magic value is written at the end of the request size to trap writes
beyond request bounds. Hence, when MALLOC_CHECK_ is exported to > 0,
malloc_usable_size() should return the request size.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* malloc.c/arena.c (reused_arena): New parameter, avoid_arena.
When avoid_arena is set, don't retry in the that arena. Pick the
next one, whatever it might be.
(arena_get2): New parameter avoid_arena, pass through to reused_arena.
(arena_lock): Pass in new parameter to arena_get2.
* malloc/malloc.c (__libc_memalign): Pass in new parameter to
arena_get2.
(__libc_malloc): Unify retrying after main arena failure with
__libc_memalign version.
(__libc_valloc, __libc_pvalloc, __libc_calloc): Likewise.
|
| |
|
| |
|
|
|
|
| |
Include shlib-compat.h for SHLIB_COMPAT.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Remove ugly names and unnecessary wrappers.
|
| |
|
| |
|
|
|
|
| |
No more __const.
|