From 35fed6f15d3d29c02203a3fe2e446e205d45b0ff Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 20 Sep 2013 11:10:55 -0300 Subject: Add probes for malloc retries. 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. --- manual/probes.texi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'manual/probes.texi') diff --git a/manual/probes.texi b/manual/probes.texi index 7f066d6a51..50e0fc24f6 100644 --- a/manual/probes.texi +++ b/manual/probes.texi @@ -26,6 +26,28 @@ the virtual memory subsystem of @theglibc{}. The location and the availability of some probes depend on whether per-thread arenas are enabled (the default) or disabled at the time @theglibc{} is compiled. +@deftp Probe memory_malloc_retry (size_t @var{$arg1}) +@deftpx Probe memory_realloc_retry (size_t @var{$arg1}, void *@var{$arg2}) +@deftpx Probe memory_memalign_retry (size_t @var{$arg1}, size_t @var{$arg2}) +@deftpx Probe memory_valloc_retry (size_t @var{$arg1}) +@deftpx Probe memory_pvalloc_retry (size_t @var{$arg1}) +@deftpx Probe memory_calloc_retry (size_t @var{$arg1}) +These probes are triggered when the corresponding functions fail to +obtain the requested amount of memory from the arena in use, before they +call @code{arena_get_retry} to select an alternate arena in which to +retry the allocation. Argument @var{$arg1} is the amount of memory +requested by the user; in the @code{calloc} case, that is the total size +computed from both function arguments. In the @code{realloc} case, +@var{$arg2} is the pointer to the memory area being resized. In the +@code{memalign} case, @var{$arg2} is the alignment to be used for the +request, which may be stricter than the value passed to the +@code{memalign} function. + +Note that the argument order does @emph{not} match that of the +corresponding two-argument functions, so that in all of these probes the +user-requested allocation size is in @var{$arg1}. +@end deftp + @deftp Probe memory_arena_new (void *@var{$arg1}, size_t @var{$arg2}) This probe is triggered when @code{malloc} allocates and initializes an additional arena (not the main arena), but before the arena is assigned -- cgit 1.4.1