This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: using C++ STL containers in GCC/gfortran source code


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.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78822#c19

> 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.

Thanks,
Pedro Alves


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