This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19614] Excessive memory consumption with a class with large (200) virtual (pure?) function and derived classes
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jan 2005 04:26:15 -0000
- Subject: [Bug c++/19614] Excessive memory consumption with a class with large (200) virtual (pure?) function and derived classes
- References: <20050124205844.19614.dmartin@cliftonlabs.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-25 04:26 -------
All of the memory seems to becoming from virtual functions, some from pure virtual functions (which
we could optimizate a little better).
/* You can't call an abstract virtual function; it's abstract.
So, we replace these functions with __pure_virtual. */
if (DECL_PURE_VIRTUAL_P (fn_original))
fn = abort_fndecl;
else if (!integer_zerop (delta) || vcall_index)
{
fn = make_thunk (fn, /*this_adjusting=*/1, delta, vcall_index);
if (!DECL_NAME (fn))
finish_thunk (fn);
}
/* Take the address of the function, considering it to be of an
appropriate generic type. */
init = build1 (ADDR_EXPR, vfunc_ptr_type_node, fn);
We could create one ADDR_EXPR for the pure virtual case which will both speed up this and create a
huge amount of less memory (how much I don't know yet but I will test it soon).
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|Excessive memory consumption|Excessive memory consumption
| |with a class with large
| |(200) virtual (pure?)
| |function and derived classes
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19614