A patch for malloc typo
H . J . Lu
hjl@lucon.org
Tue Sep 19 12:03:00 GMT 2000
On Tue, Sep 19, 2000 at 11:52:33AM -0700, H . J . Lu wrote:
> The order of parameters passed to mEMALIGn in memalign_hook_ini is
> wrong. Here is a patch.
>
> --
> H.J. Lu (hjl@gnu.org)
> ---
> 2000-09-19 H.J. Lu <hjl@gnu.org>
>
> * malloc/malloc.c (memalign_hook_ini): Fix the mEMALIGn call.
>
> Index: malloc/malloc.c
> ===================================================================
> RCS file: /work/cvs/gnu/glibc/malloc/malloc.c,v
> retrieving revision 1.1.1.9
> diff -u -p -r1.1.1.9 malloc.c
> --- malloc/malloc.c 2000/08/31 16:48:37 1.1.1.9
> +++ malloc/malloc.c 2000/09/19 18:50:18
> @@ -1780,7 +1780,7 @@ memalign_hook_ini(sz, alignment, caller)
> {
> __memalign_hook = NULL;
> ptmalloc_init();
> - return mEMALIGn(sz, alignment);
> + return mEMALIGn(alignment, sz);
> }
>
> void weak_variable (*__malloc_initialize_hook) __MALLOC_P ((void)) = NULL;
Well, this patch is not right since memalign_hook_ini () has everything
reversed. The code is ok. It is just that alignment and sz are very
misleading. I will send a patch to fix everything.
H.J.
More information about the Libc-hacker
mailing list