mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 07:49:12 +02:00
* rtti is always aligned, remove move() workarounds
This commit is contained in:
parent
2e91bcf821
commit
35e7518475
@ -45,7 +45,7 @@ Const
|
|||||||
|
|
||||||
type
|
type
|
||||||
TRTTIProc=procedure(Data,TypeInfo:Pointer);
|
TRTTIProc=procedure(Data,TypeInfo:Pointer);
|
||||||
|
|
||||||
procedure RecordRTTI(Data,TypeInfo:Pointer;rttiproc:TRTTIProc);
|
procedure RecordRTTI(Data,TypeInfo:Pointer;rttiproc:TRTTIProc);
|
||||||
{
|
{
|
||||||
A record is designed as follows :
|
A record is designed as follows :
|
||||||
@ -73,27 +73,15 @@ begin
|
|||||||
temp:=aligntoptr(temp);
|
temp:=aligntoptr(temp);
|
||||||
{ Skip size }
|
{ Skip size }
|
||||||
inc(Temp,4);
|
inc(Temp,4);
|
||||||
{ Element count }
|
{ Element count }
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
Count:=PLongint(Temp)^;
|
||||||
move(Temp^,Count,sizeof(Count));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
Count:=PLongint(Temp)^;
|
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Count));
|
inc(Temp,sizeof(Count));
|
||||||
{ Process elements }
|
{ Process elements }
|
||||||
for i:=1 to count Do
|
for i:=1 to count Do
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
Info:=PPointer(Temp)^;
|
||||||
move(Temp^,Info,sizeof(Info));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
Info:=PPointer(Temp)^;
|
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Info));
|
inc(Temp,sizeof(Info));
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
move(Temp^,Offset,sizeof(Offset));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
Offset:=PLongint(Temp)^;
|
Offset:=PLongint(Temp)^;
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Offset));
|
inc(Temp,sizeof(Offset));
|
||||||
rttiproc (Data+Offset,Info);
|
rttiproc (Data+Offset,Info);
|
||||||
end;
|
end;
|
||||||
@ -125,24 +113,12 @@ begin
|
|||||||
inc(temp,namelen+1);
|
inc(temp,namelen+1);
|
||||||
temp:=aligntoptr(temp);
|
temp:=aligntoptr(temp);
|
||||||
{ Element size }
|
{ Element size }
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
move(Temp^,size,sizeof(size));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
size:=PLongint(Temp)^;
|
size:=PLongint(Temp)^;
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Size));
|
inc(Temp,sizeof(Size));
|
||||||
{ Element count }
|
{ Element count }
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
Count:=PLongint(Temp)^;
|
||||||
move(Temp^,Count,sizeof(Count));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
Count:=PLongint(Temp)^;
|
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Count));
|
inc(Temp,sizeof(Count));
|
||||||
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
|
Info:=PPointer(Temp)^;
|
||||||
move(Temp^,Info,sizeof(Info));
|
|
||||||
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
Info:=PPointer(Temp)^;
|
|
||||||
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
||||||
inc(Temp,sizeof(Info));
|
inc(Temp,sizeof(Info));
|
||||||
{ Process elements }
|
{ Process elements }
|
||||||
for I:=0 to Count-1 do
|
for I:=0 to Count-1 do
|
||||||
@ -271,7 +247,10 @@ procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); [Pub
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.17 2004-10-24 21:39:42 peter
|
Revision 1.18 2004-10-26 15:02:51 peter
|
||||||
|
* rtti is always aligned, remove move() workarounds
|
||||||
|
|
||||||
|
Revision 1.17 2004/10/24 21:39:42 peter
|
||||||
* record and array parsing moved to procedure and handle like
|
* record and array parsing moved to procedure and handle like
|
||||||
a data stream instead of using records
|
a data stream instead of using records
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user