[PATCH] fix to malloc checking
Mike Frysinger
vapier@gentoo.org
Wed Apr 8 03:11:00 GMT 2015
On 07 Apr 2015 09:44, James Lemke wrote:
> On 04/04/2015 11:05 PM, Mike Frysinger wrote:
> > On 11 Mar 2015 14:00, James Lemke wrote:
> >> On 03/01/2015 10:08 PM, Mike Frysinger wrote:
> >>> On 04 Feb 2015 13:56, James Lemke wrote:
> >>>> --- a/malloc/hooks.c
> >>>> +++ b/malloc/hooks.c
> >>>> +{
> >>>> + unsigned char magic;
> >>>> +
> >>>> + magic = (((size_t) p >> 3) ^ ((size_t) p >> 11)) & 0xFF;
> >>>
> >>> shouldn't you use uintptr_t instead of size_t ?
> >>
> >> It is size_t because that's what the previous macro implementation used.
> >> I don't see a strong reason to change the casts to uinptr_t,
> >> but if you do I'll change them.
> >
> > uintptr_t is the only type you can safely cast a pointer, but if the rest of the
> > code is already using size_t, no need to change that in this commit
>
> Hmm. There is no other spot in the current code that uses (size_t). I have
> tested with (uintptr_t) and get the same results so I will switch to the
> latter.
>
> OK to commit with that change?
probably ? :) please post the latest version.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150408/ae9257d3/attachment.sig>
More information about the Libc-alpha
mailing list