This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: libstdc++/16612, empty basic_strings can't live in shared memory


Nathan Myers wrote:

On Wed, Aug 04, 2004 at 09:27:37PM +0200, Paolo Carlini wrote:


However, as Nathan wrote, "let's not be hasty": it's the first time
in *years* that someone notices this problem, and I still have hopes
there is an even better solution: operator[] is such a *basic*
operation and would be *so* sad adding a conditional...



Not to mention that length(), capacity(), and (really) everything else besides would need the same treatment.

I like the idea of using static space in libsupc++. It's simpler,
and should improve performance of the plain vanilla string, too, by avoiding relocation indirections. Can anybody say whether it could be arranged for static storage in libsupc++ to appear at the same address in all programs compiled for a given ABI version?


It cannot be so arranged on some systems. For example, some systems allocate memory to shared objects based on link order, so unless libsupc++ is always the first library, one can't be sure it will end up at the same place. Also, if multiple libraries want to be loaded at the same address, the dynamic linker will have to pick one.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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