This is the mail archive of the gcc-patches@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]

[PATCH] allow ggc_calloc pass the MEMstats


I noticed this while looking into ways of reducing the GC memory
usage for PR 12850.

We are not recording where ggc_calloc is called at all but we are just
saying it comes from ggc-common.c which is wrong for most cases.
This fixes the problem by passing MEMSTATS.  I had to keep a ggc_calloc
still because we use that we need to for hashtable stills.

Yes this is not a regression but a very light weight (safe) fix which
can help a lot finding memory allocation problems.

OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
	* ggc.h (ggc_calloc_stat): Declare.
	(ggc_calloc): New macro calling ggc_calloc_stat.
	* ggc-common.c (ggc_calloc_stat): New function.
	(ggc_calloc): Wrap name with ().

Attachment: ggc_alloc_memstats.diff.txt
Description: Text document


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