From 5e82863f3f5b23033f6151d6d6cd3fedb64482a1 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 21 Mar 2004 22:41:29 +0000 Subject: [PATCH] * CleanupInstance takes now care of FPC_REQUIRES_PROPER_ALIGNMENT --- rtl/inc/objpas.inc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/rtl/inc/objpas.inc b/rtl/inc/objpas.inc index 9e01f48281..a69383aa5b 100644 --- a/rtl/inc/objpas.inc +++ b/rtl/inc/objpas.inc @@ -523,12 +523,15 @@ Size,Count : Longint; Elements : TRecElemArray; end; - + var vmt : tclass; temp : pbyte; count, i : longint; +{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} + recelem : TRecElem; +{$endif FPC_REQUIRES_PROPER_ALIGNMENT} begin vmt:=ClassType; while vmt<>nil do @@ -541,11 +544,23 @@ inc(Temp); I:=Temp^; inc(temp,I+1); // skip name string; +{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} + move(PRecRec(Temp)^.Count,Count,sizeof(Count)); +{$else FPC_REQUIRES_PROPER_ALIGNMENT} Count:=PRecRec(Temp)^.Count; // get element Count +{$endif FPC_REQUIRES_PROPER_ALIGNMENT} For I:=1 to count do +{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} + begin + move(PRecRec(Temp)^.elements[I],RecElem,sizeof(RecElem)); + With RecElem do + int_Finalize (pointer(self)+Offset,Info); + end; +{$else FPC_REQUIRES_PROPER_ALIGNMENT} With PRecRec(Temp)^.elements[I] do int_Finalize (pointer(self)+Offset,Info); - end; +{$endif FPC_REQUIRES_PROPER_ALIGNMENT} + end; vmt:=pclass(pointer(vmt)+vmtParent)^; end; end; @@ -722,7 +737,10 @@ { $Log$ - Revision 1.34 2004-02-26 16:19:01 peter + Revision 1.35 2004-03-21 22:41:29 florian + * CleanupInstance takes now care of FPC_REQUIRES_PROPER_ALIGNMENT + + Revision 1.34 2004/02/26 16:19:01 peter * tkclass removed from finalize() * cleanupinstance now parses the tkclass rtti entry itself and calls finalize() for the rtti members