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]

Re: [PATCH] improve memory use with a large number of pure virtualclass functions


Andrew Pinski <pinskia@physics.uc.edu> writes:

> In the C++ front-end we produce a vtable with pure member functions
> and we take the address of an abort function but since this abort
> function never changes, really there is no reason why we cannot
> share the ADDR_EXPR for the abort function.  This saves about 6M on
> PR 19614 on powerpc-darwin (about 2% of the total allocated memory
> and about 5M left at the end of complication or about 4.8%).  So this
> is not a small micro optimization for this testcase but note this
> testcase is weird in that it has more than 200 pure virtual member
> functions in one of its classes.

I wonder why we don't just use nulls, but...

> 	* class.c (abort_fndecl_addr): New variable.
> 	(build_vtbl_initializer): If we have a pure virtual function
> 	share the abort function's address.
> 	Include gt-cp-class.h at the end.
> 	* config-lang.in (gtfiles): Add cp/class.c.

... this is OK.

zw


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