This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/19495] basic_string::_M_rep() can produce an unnaturally aligned pointer to _Rep
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jan 2005 15:57:20 -0000
- Subject: [Bug libstdc++/19495] basic_string::_M_rep() can produce an unnaturally aligned pointer to _Rep
- References: <20050118051448.19495.bje@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-01-19 15:57 -------
Subject: Re: basic_string::_M_rep() can produce an unnaturally aligned pointer to _Rep
"pcarlini at suse dot de" <gcc-bugzilla@gcc.gnu.org> writes:
| > Does this behaviour seem a little bit unusual to you? You said: "You
| > cannot create a basic_string<char> object in memory aligned one".
| > That is rather counter-intuitive to a user of libstdc++ who has no
| > understanding of the implementation details of basic_string.
|
| I don't think so. Memory provided by new, f.i., is never returned aligned
| one. Quite to the contrary, *missing* a knowledge of the internal impl
| details, you are supposed to pass to the string object an allocator
| returning memory maximally aligned (like the default one does!)
I don't understand the reasoning here.
The allocator is that for char, which is required to provide
storagte aligned only for char, i.e. in this particular case.
Therefore we have real issue with _Rep.
This is basically the same issue as the one filled by
James Kanze.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19495