This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add tst-mallocalign1


On Thu, May 17, 2012 at 11:28 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, May 17, 2012 at 8:11 AM, Carlos O'Donell
> <carlos@systemhalted.org> wrote:
>> On Thu, May 17, 2012 at 10:39 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> Hi,
>>>
>>> This patch adds tst-mallocalign1 to test malloc alignment. ?Tested on
>>> Linux/x86-64. ?OK to install?
>>>
>>> Thanks.
>>>
>>>
>>> H.J.
>>> ---
>>> ? ? ? ?* sysdeps/x86_64/Makefile (tests): Add tst-mallocalign1.
>>> ? ? ? ?* sysdeps/x86_64/tst-mallocalign1.c: New file.
>>
>> This looks good to me.

OK to checkin if you adjust the testcase to use test-skeleton.c.

>> I trust you know the psABI requirement, so I didn't double check that.
>>
>> I figure that if malloc/malloc.c (MALLOC_ALIGNMENT) changes to be
>> below the requirement that this test would trigger a regression?
>
> Yes.
>
>> At present we have ((2 * sizeof(size_t)) - 1) which should be (16 - 1)
>> and meet the required minimum.
>>
>> Does that make sense?
>
> Since size_t is 4 bytes and malloc alignment is 16 for x32, this test
> is to make sure that we get it right for x32.

Won't this mean that MALLOC_ALIGNMENT on x32 is 8 instead of 16 or did
I miss a patch where x32 defines MALLOC_ALIGNMENT to something else or
sets INTERNAL_SIZE_T?

Ah! I see the patch "PATCH: Define MALLOC_ALIGNMENT as 16 for x32",
and I see Roland is already reviewing it.

Cheers,
Carlos


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]