summaryrefslogtreecommitdiff
path: root/malloc/malloc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-12-17 23:52:56 +0000
committerUlrich Drepper <drepper@redhat.com>2003-12-17 23:52:56 +0000
commite796f92f68585f61412f569e4b4f49b5e21d80df (patch)
treeb3cb5d9bf8e91e54d6d443330b2bad65ac867580 /malloc/malloc.c
parent0278652840d0b09297986baee97ab46c136f304c (diff)
Update.
2003-12-17 Jakub Jelinek <jakub@redhat.com> * malloc/mtrace.c (tr_old_memalign_hook): New variable. (tr_memalignhook): New function. (mtrace): Register tr_memalignhook. (muntrace): Deregister tr_memalignhook. * malloc/malloc.c (__posix_memalign): If __memalign_hook != NULL, call it directly instead of memalign_internal. 2003-12-17 Ulrich Drepper <drepper@redhat.com> * misc/mntent_r.c: Change encoding to match recently change decoder. Patch by Alexander Achenbach <xela@slit.de>. 2003-12-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Correct definition of vrregset_t. 2003-12-16 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/unix/sysv/linux/powerpc/sys/procfs.h [!__PPC64_ELF_H]: Extent conditional to include typedef elf_vrreg_t. 2002-12-17 Paolo Bonzini <bonzini@gnu.org> * posix/regexec.c (re_search_internal): Limit search to the beginning of the buffer if the initial states are empty for contexts that do not include CONTEXT_BEGBUF or, if !preg->newline_anchor, that do not include any one of CONTEXT_BEGBUF and CONTEXT_NEWLINE.
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r--malloc/malloc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index c26d6676aa..4e959d20a2 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -5389,13 +5389,21 @@ int
__posix_memalign (void **memptr, size_t alignment, size_t size)
{
void *mem;
+ __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
+ __const __malloc_ptr_t)) =
+ __memalign_hook;
/* Test whether the SIZE argument is valid. It must be a power of
two multiple of sizeof (void *). */
if (alignment % sizeof (void *) != 0 || !powerof2 (alignment) != 0)
return EINVAL;
- mem = __memalign_internal (alignment, size);
+ /* Call the hook here, so that caller is posix_memalign's caller
+ and not posix_memalign itself. */
+ if (hook != NULL)
+ mem = (*hook)(alignment, size, RETURN_ADDRESS (0));
+ else
+ mem = __memalign_internal (alignment, size);
if (mem != NULL) {
*memptr = mem;