Skip to content

Commit

Permalink
* change RecInitTable into a direct reference to avoid an unnecessary…
Browse files Browse the repository at this point in the history
… indirection as both the full and init RTTI of a record always reside inside the same unit

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@35128 3ad0048d-3df7-0310-abae-a5850022a9f2
  • Loading branch information
svenbarth committed Dec 14, 2016
1 parent 4cc1332 commit 908c7ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion compiler/ncgrtti.pas
Expand Up @@ -863,7 +863,9 @@ ((def.typ=recorddef) or
begin
{ point to more optimal init table }
include(def.defstates,ds_init_table_used);
write_rtti_reference(tcb,def,initrtti);
{ we use a direct reference as the init RTTI is always in the same
unit as the full RTTI }
tcb.emit_tai(Tai_const.Create_sym(ref_rtti(def,initrtti,false)),voidpointertype);
end;

tcb.emit_ord_const(def.size,u32inttype);
Expand Down
4 changes: 2 additions & 2 deletions rtl/inc/rtti.inc
Expand Up @@ -49,7 +49,7 @@ type
{$endif USE_PACKED}
record
{$ifndef VER3_0}
InitTable: PPointer;
InitTable: Pointer;
{$endif VER3_0}
Size: Longint;
Count: Longint;
Expand Down Expand Up @@ -116,7 +116,7 @@ begin
{ check terminator, maybe we are already in init table }
if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then
{ point to more optimal initrtti }
result:=PRecordInfoFull(result)^.InitTable^;
result:=PRecordInfoFull(result)^.InitTable;
{$endif VER3_0}
end;

Expand Down
2 changes: 1 addition & 1 deletion rtl/objpas/typinfo.pp
Expand Up @@ -270,7 +270,7 @@ TTypeInfo = record
tkRecord:
(
{$ifndef VER3_0}
RecInitTable: PPointer;
RecInitTable: Pointer; { points to TTypeInfo followed by init table }
{$endif VER3_0}
RecSize: Integer;
ManagedFldCount: Integer;
Expand Down

0 comments on commit 908c7ee

Please sign in to comment.