
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 02 August 2009, Christian Schladetsch wrote:
On Mon, Aug 3, 2009 at 5:44 AM, Frank Mori Hess <fmhess@speakeasy.net>wrote:
On Saturday 01 August 2009, Mathias Gaunard wrote:
I personally never understood why they tied the type into the allocator. Having just the size and alignment would be so much better.
It seems to me any benefits of such a scheme would be non-portable, since the sizes and alignments of two types may be the same with one compiler (setting) and different with others.
I don't see a problem. As long as the objects are created with correct alignment for a given compiler (setting), what that alignment is, is not important.
I wasn't following the thread too closely, but I assumed the benefit of using size+alignment instead of type would be that you could reuse the same allocator with different types (as long as they had the same size and alignment). But since a type's size+alignment varies across platforms, you wouldn't be able to portably reuse such an allocator with different types (hence no portable benefit). -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkp3C30ACgkQ5vihyNWuA4Ua8wCglhRtt1cSITwrVJ/9dP61dOF5 700AniWhvKV/l2Yq+VIEnsSODZjNWr+H =dl4g -----END PGP SIGNATURE-----