[PATCH] D15539: [libcxxabi] Reducing stack usage of test

Jonathan Roelofs via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 16 12:06:06 PST 2015


jroelofs added a comment.

In http://reviews.llvm.org/D15539#312332, @bcraig wrote:

> In http://reviews.llvm.org/D15539#312319, @jroelofs wrote:
>
> > What does having them be `long double`s give over just multiplying the counts by 16 (or however big it is on your platform)? Alignment?
> >
> > Seems like it'd be better to start with a prime that's ~16x larger, say 211, than to have that factor of 16 floating around everywhere.
>
>
> Alignment is the main answer.  I'd use max_align_t directly, except that it got added in C++11, and this test should be able to run in C++98 and C++03.
>  Using a large type instead of a char also makes it easier to avoid making two padding values that look different, but aren't actually all that different due to internal padding.  Just starting at a high prime wouldn't fix this, as then I have to ensure that consecutive values are separated by at least sizeof(void *).


What platform are you on where sizeof(void*) is anywhere near 13 bytes?


http://reviews.llvm.org/D15539





More information about the cfe-commits mailing list