+ tobjectdef.members_need_inittable that is used to generate only the

inittable when it is really used. This saves a lot of useless calls
    to fpc_finalize when destroying classes
This commit is contained in:
peter 2002-10-19 15:09:24 +00:00
parent 0006cdde37
commit d27f79ae28
3 changed files with 33 additions and 10 deletions

View File

@ -1268,8 +1268,11 @@ implementation
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
else
dataSegment.concat(Tai_const.Create_32bit(0));
{ inittable for con-/destruction, for classes this is always generated }
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)));
{ inittable for con-/destruction }
if _class.members_need_inittable then
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)))
else
dataSegment.concat(Tai_const.Create_32bit(0));
{ auto table }
dataSegment.concat(Tai_const.Create_32bit(0));
{ interface table }
@ -1314,7 +1317,12 @@ initialization
end.
{
$Log$
Revision 1.31 2002-10-15 19:00:42 peter
Revision 1.32 2002-10-19 15:09:24 peter
+ tobjectdef.members_need_inittable that is used to generate only the
inittable when it is really used. This saves a lot of useless calls
to fpc_finalize when destroying classes
Revision 1.31 2002/10/15 19:00:42 peter
* small tweak to use speedvalue before comparing strings
Revision 1.30 2002/10/06 16:40:25 florian

View File

@ -511,11 +511,9 @@ implementation
{ generate persistent init/final tables when it's declared in the interface so it can
be reused in other used }
if (not current_module.in_implementation) and
(tt.def.needs_inittable or
(is_class(tt.def) and
not(oo_is_forward in tobjectdef(tt.def).objectoptions)
)
) then
((is_class(tt.def) and
tobjectdef(tt.def).members_need_inittable) or
tt.def.needs_inittable) then
generate_inittable(newtype);
{ for objects we should write the vmt and interfaces.
@ -630,7 +628,12 @@ implementation
end.
{
$Log$
Revision 1.55 2002-10-14 19:45:02 peter
Revision 1.56 2002-10-19 15:09:25 peter
+ tobjectdef.members_need_inittable that is used to generate only the
inittable when it is really used. This saves a lot of useless calls
to fpc_finalize when destroying classes
Revision 1.55 2002/10/14 19:45:02 peter
* only allow threadvar when threading switch is defined
Revision 1.54 2002/10/06 12:25:05 florian

View File

@ -274,6 +274,7 @@ interface
function size : longint;override;
function alignment:longint;override;
function vmtmethodoffset(index:longint):longint;
function members_need_inittable : boolean;
function is_publishable : boolean;override;
function needs_inittable : boolean;override;
function vmt_mangledname : string;
@ -4647,6 +4648,12 @@ implementation
end;
function tobjectdef.members_need_inittable : boolean;
begin
members_need_inittable:=tobjectsymtable(symtable).needs_init_final;
end;
procedure tobjectdef.count_published_properties(sym:tnamedindexitem;arg:pointer);
begin
if needs_prop_entry(tsym(sym)) and
@ -5452,7 +5459,12 @@ implementation
end.
{
$Log$
Revision 1.99 2002-10-07 21:30:27 peter
Revision 1.100 2002-10-19 15:09:25 peter
+ tobjectdef.members_need_inittable that is used to generate only the
inittable when it is really used. This saves a lot of useless calls
to fpc_finalize when destroying classes
Revision 1.99 2002/10/07 21:30:27 peter
* removed obsolete rangecheck stuff
Revision 1.98 2002/10/05 15:14:26 peter