mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 21:49:18 +02:00
+ 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:
parent
0006cdde37
commit
d27f79ae28
@ -1268,8 +1268,11 @@ implementation
|
|||||||
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
|
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
|
||||||
else
|
else
|
||||||
dataSegment.concat(Tai_const.Create_32bit(0));
|
dataSegment.concat(Tai_const.Create_32bit(0));
|
||||||
{ inittable for con-/destruction, for classes this is always generated }
|
{ inittable for con-/destruction }
|
||||||
dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)));
|
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 }
|
{ auto table }
|
||||||
dataSegment.concat(Tai_const.Create_32bit(0));
|
dataSegment.concat(Tai_const.Create_32bit(0));
|
||||||
{ interface table }
|
{ interface table }
|
||||||
@ -1314,7 +1317,12 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* small tweak to use speedvalue before comparing strings
|
||||||
|
|
||||||
Revision 1.30 2002/10/06 16:40:25 florian
|
Revision 1.30 2002/10/06 16:40:25 florian
|
||||||
|
@ -511,11 +511,9 @@ implementation
|
|||||||
{ generate persistent init/final tables when it's declared in the interface so it can
|
{ generate persistent init/final tables when it's declared in the interface so it can
|
||||||
be reused in other used }
|
be reused in other used }
|
||||||
if (not current_module.in_implementation) and
|
if (not current_module.in_implementation) and
|
||||||
(tt.def.needs_inittable or
|
((is_class(tt.def) and
|
||||||
(is_class(tt.def) and
|
tobjectdef(tt.def).members_need_inittable) or
|
||||||
not(oo_is_forward in tobjectdef(tt.def).objectoptions)
|
tt.def.needs_inittable) then
|
||||||
)
|
|
||||||
) then
|
|
||||||
generate_inittable(newtype);
|
generate_inittable(newtype);
|
||||||
|
|
||||||
{ for objects we should write the vmt and interfaces.
|
{ for objects we should write the vmt and interfaces.
|
||||||
@ -630,7 +628,12 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* only allow threadvar when threading switch is defined
|
||||||
|
|
||||||
Revision 1.54 2002/10/06 12:25:05 florian
|
Revision 1.54 2002/10/06 12:25:05 florian
|
||||||
|
@ -274,6 +274,7 @@ interface
|
|||||||
function size : longint;override;
|
function size : longint;override;
|
||||||
function alignment:longint;override;
|
function alignment:longint;override;
|
||||||
function vmtmethodoffset(index:longint):longint;
|
function vmtmethodoffset(index:longint):longint;
|
||||||
|
function members_need_inittable : boolean;
|
||||||
function is_publishable : boolean;override;
|
function is_publishable : boolean;override;
|
||||||
function needs_inittable : boolean;override;
|
function needs_inittable : boolean;override;
|
||||||
function vmt_mangledname : string;
|
function vmt_mangledname : string;
|
||||||
@ -4647,6 +4648,12 @@ implementation
|
|||||||
end;
|
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);
|
procedure tobjectdef.count_published_properties(sym:tnamedindexitem;arg:pointer);
|
||||||
begin
|
begin
|
||||||
if needs_prop_entry(tsym(sym)) and
|
if needs_prop_entry(tsym(sym)) and
|
||||||
@ -5452,7 +5459,12 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* removed obsolete rangecheck stuff
|
||||||
|
|
||||||
Revision 1.98 2002/10/05 15:14:26 peter
|
Revision 1.98 2002/10/05 15:14:26 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user