On Apr 30, 2013, at 5:59 PM, Joerg Sonnenberger <[email protected]> wrote:
> On Tue, Apr 30, 2013 at 09:44:48PM -0000, Howard Hinnant wrote: >> Author: hhinnant >> Date: Tue Apr 30 16:44:48 2013 >> New Revision: 180811 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=180811&view=rev >> Log: >> This patch introduces an alternative layout for basic_string which when >> the string is short, the data pointer will be word-aligned. It can be >> activated with -D_LIBCPP_ALTERNATE_STRING_LAYOUT. > > What are the relative advantages of either? The current layout, when the basic_string is short, has a data() pointer that is aligned to the alignment of the value_type (e.g. 1-byte aligned for string). With _LIBCPP_ALTERNATE_STRING_LAYOUT, the same data() pointer will be 4-byte aligned on a 32 bit platform and 8-byte aligned on 64 bit platform. When the string is long, there is no difference. data() will be aligned to whatever the allocator returns (16-bytes on Apple platforms). Howard _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
