This is the mail archive of the
mailing list for the GCC project.
Re: using C++ STL containers in GCC/gfortran source code
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "N.M. Maclaren" <nmm1 at cam dot ac dot uk>, gcc mailing list <gcc at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 16 Dec 2016 19:31:50 +0100
- Subject: Re: using C++ STL containers in GCC/gfortran source code
- Authentication-results: sourceware.org; auth=none
- References: <CAKwh3qgUN=mTFPg6Ew6Yk9RXgS3CttE7O3cGMQRcLKNqUOjBng@mail.gmail.com> <Prayer.firstname.lastname@example.org> <CAKwh3qhj-y5U9RrJ+nP45fGjRL2JbEKGKcVw4nsXMp-=h8jq-Q@mail.gmail.com> <email@example.com>
2016-12-16 18:53 GMT+01:00 Pedro Alves <firstname.lastname@example.org>:
> On 12/16/2016 05:33 PM, Janus Weil wrote:
>> "You would need to make sure it uses a xmalloc based allocator first
>> or at least calls xmalloc_failed upon allocation failure, otherwise it
>> will be a serious regression."
>> I'm really not an expert on GCC's memory management principles and how
>> it uses xmalloc over malloc. I'd love to hear further comments on the
>> above sentence (e.g. whether that is really necessary, and if yes, how
>> to accomplish it).
> I gave a suggestion in the PR.
> Basically, you can replace the global operator new to call xmalloc
> instead of malloc. See the GDB url in the PR for an example.
Thanks for the comment!
>> And in particular: How do the current uses of
>> std::string in GCC deal with this problem? (Do they?)
> Doesn't look like they do.
Huh, that's a problem then, isn't it?