|
@@ -16,26 +16,17 @@
|
|
|
|
|
|
function RTTIArraySize(typeInfo: Pointer): SizeInt;
|
|
function RTTIArraySize(typeInfo: Pointer): SizeInt;
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
result:=PArrayInfo(typeInfo)^.Size;
|
|
result:=PArrayInfo(typeInfo)^.Size;
|
|
end;
|
|
end;
|
|
|
|
|
|
function RTTIRecordSize(typeInfo: Pointer): SizeInt;
|
|
function RTTIRecordSize(typeInfo: Pointer): SizeInt;
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
{ for size field init table is compatible with rtti table }
|
|
{ for size field init table is compatible with rtti table }
|
|
result:=PRecordInfoFull(typeInfo)^.Size;
|
|
result:=PRecordInfoFull(typeInfo)^.Size;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$ifndef VER3_0}
|
|
|
|
function RTTIRecordOp(typeInfo: Pointer; var initrtti: Pointer): PRecordInfoInit; inline;
|
|
function RTTIRecordOp(typeInfo: Pointer; var initrtti: Pointer): PRecordInfoInit; inline;
|
|
begin
|
|
begin
|
|
{ find init table and management operators }
|
|
{ find init table and management operators }
|
|
@@ -51,31 +42,11 @@ begin
|
|
result:=aligntoqword(initrtti+2+PByte(initrtti)[1]);
|
|
result:=aligntoqword(initrtti+2+PByte(initrtti)[1]);
|
|
end
|
|
end
|
|
end;
|
|
end;
|
|
-{$else VER3_0}
|
|
|
|
-function RTTIRecordRttiInfoToInitInfo(typeInfo: Pointer): Pointer; inline;
|
|
|
|
-begin
|
|
|
|
- result:=typeInfo;
|
|
|
|
-{$ifndef VER3_0}
|
|
|
|
- { find init table }
|
|
|
|
- typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-
|
|
|
|
- { check terminator, maybe we are already in init table }
|
|
|
|
- if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then
|
|
|
|
- { point to more optimal initrtti }
|
|
|
|
- result:=PRecordInfoFull(typeInfo)^.InitTable;
|
|
|
|
-{$endif VER3_0}
|
|
|
|
-end;
|
|
|
|
-{$endif VER3_0}
|
|
|
|
|
|
|
|
-{$ifndef VER3_0}
|
|
|
|
function RTTISizeAndOp(typeInfo: Pointer;
|
|
function RTTISizeAndOp(typeInfo: Pointer;
|
|
const expectedManagementOp: TRTTIRecOpType; out hasManagementOp: boolean): SizeInt;
|
|
const expectedManagementOp: TRTTIRecOpType; out hasManagementOp: boolean): SizeInt;
|
|
begin
|
|
begin
|
|
hasManagementOp:=false;
|
|
hasManagementOp:=false;
|
|
-{$else VER3_0}
|
|
|
|
-function RTTISize(typeInfo: Pointer): SizeInt;
|
|
|
|
-begin
|
|
|
|
-{$endif VER3_0}
|
|
|
|
case PTypeKind(typeinfo)^ of
|
|
case PTypeKind(typeinfo)^ of
|
|
tkAString,tkWString,tkUString,
|
|
tkAString,tkWString,tkUString,
|
|
tkInterface,tkDynarray:
|
|
tkInterface,tkDynarray:
|
|
@@ -86,7 +57,6 @@ begin
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
{$endif FPC_HAS_FEATURE_VARIANTS}
|
|
tkArray:
|
|
tkArray:
|
|
result:=RTTIArraySize(typeinfo);
|
|
result:=RTTIArraySize(typeinfo);
|
|
-{$ifndef VER3_0}
|
|
|
|
tkObject:
|
|
tkObject:
|
|
result:=RTTIRecordSize(typeinfo);
|
|
result:=RTTIRecordSize(typeinfo);
|
|
tkRecord:
|
|
tkRecord:
|
|
@@ -102,10 +72,6 @@ begin
|
|
rotCopy: hasManagementOp:=Assigned(RecordOp^.Copy);
|
|
rotCopy: hasManagementOp:=Assigned(RecordOp^.Copy);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-{$else VER3_0}
|
|
|
|
- tkObject,tkRecord:
|
|
|
|
- result:=RTTIRecordSize(typeinfo);
|
|
|
|
-{$endif VER3_0}
|
|
|
|
else
|
|
else
|
|
result:=-1;
|
|
result:=-1;
|
|
end;
|
|
end;
|
|
@@ -117,31 +83,23 @@ var
|
|
count,
|
|
count,
|
|
i : longint;
|
|
i : longint;
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
Count:=PRecordInfoInit(typeInfo)^.Count;
|
|
Count:=PRecordInfoInit(typeInfo)^.Count;
|
|
{ Get element info, hacky, but what else can we do? }
|
|
{ Get element info, hacky, but what else can we do? }
|
|
typeInfo:=AlignTypeData(Pointer(@PRecordInfoInit(typeInfo)^.Count)+SizeOf(PRecordInfoInit(typeInfo)^.Count));
|
|
typeInfo:=AlignTypeData(Pointer(@PRecordInfoInit(typeInfo)^.Count)+SizeOf(PRecordInfoInit(typeInfo)^.Count));
|
|
{ Process elements }
|
|
{ Process elements }
|
|
for i:=1 to count Do
|
|
for i:=1 to count Do
|
|
begin
|
|
begin
|
|
- rttiproc(Data+PRecordElement(typeInfo)^.Offset,PRecordElement(typeInfo)^.TypeInfo{$ifndef VER3_0}^{$endif});
|
|
|
|
|
|
+ rttiproc(Data+PRecordElement(typeInfo)^.Offset,PRecordElement(typeInfo)^.TypeInfo^);
|
|
Inc(PRecordElement(typeInfo));
|
|
Inc(PRecordElement(typeInfo));
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-
|
|
|
|
-{$ifndef VER3_0}
|
|
|
|
function RTTIRecordMopInitTable(ti: Pointer): PRTTIRecordOpOffsetTable;
|
|
function RTTIRecordMopInitTable(ti: Pointer): PRTTIRecordOpOffsetTable;
|
|
begin
|
|
begin
|
|
ti:=aligntoqword(ti+2+PByte(ti)[1]);
|
|
ti:=aligntoqword(ti+2+PByte(ti)[1]);
|
|
Result:=PRecordInfoInit(ti)^.InitRecordOpTable;
|
|
Result:=PRecordInfoInit(ti)^.InitRecordOpTable;
|
|
end;
|
|
end;
|
|
-{$endif VER3_0}
|
|
|
|
-
|
|
|
|
|
|
|
|
{ if you modify this procedure, fpc_copy must be probably modified as well }
|
|
{ if you modify this procedure, fpc_copy must be probably modified as well }
|
|
procedure ArrayRTTI(Data,TypeInfo:Pointer;rttiproc:TRTTIProc);
|
|
procedure ArrayRTTI(Data,TypeInfo:Pointer;rttiproc:TRTTIProc);
|
|
@@ -149,17 +107,13 @@ var
|
|
i,Count,ElSize: SizeInt;
|
|
i,Count,ElSize: SizeInt;
|
|
Info: Pointer;
|
|
Info: Pointer;
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
Count:=PArrayInfo(typeInfo)^.ElCount;
|
|
Count:=PArrayInfo(typeInfo)^.ElCount;
|
|
{ no elements to process => exit }
|
|
{ no elements to process => exit }
|
|
if Count = 0 then
|
|
if Count = 0 then
|
|
Exit;
|
|
Exit;
|
|
ElSize:=PArrayInfo(typeInfo)^.Size div Count;
|
|
ElSize:=PArrayInfo(typeInfo)^.Size div Count;
|
|
- Info:=PArrayInfo(typeInfo)^.ElInfo{$ifndef VER3_0}^{$endif};
|
|
|
|
|
|
+ Info:=PArrayInfo(typeInfo)^.ElInfo^;
|
|
{ Process elements }
|
|
{ Process elements }
|
|
for I:=0 to Count-1 do
|
|
for I:=0 to Count-1 do
|
|
rttiproc(Data+(I*ElSize),Info);
|
|
rttiproc(Data+(I*ElSize),Info);
|
|
@@ -185,7 +139,6 @@ begin
|
|
tkObject,
|
|
tkObject,
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
tkRecord:
|
|
tkRecord:
|
|
-{$ifndef VER3_0}
|
|
|
|
{ if possible try to use more optimal initrtti }
|
|
{ if possible try to use more optimal initrtti }
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
begin
|
|
begin
|
|
@@ -193,12 +146,6 @@ begin
|
|
if Assigned(recordop) and Assigned(recordop^.Initialize) then
|
|
if Assigned(recordop) and Assigned(recordop^.Initialize) then
|
|
recordop^.Initialize(data);
|
|
recordop^.Initialize(data);
|
|
end;
|
|
end;
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
|
|
|
|
- recordrtti(data,typeinfo,@int_initialize);
|
|
|
|
- end;
|
|
|
|
-{$endif VER3_0}
|
|
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
{$ifdef FPC_HAS_FEATURE_VARIANTS}
|
|
tkVariant:
|
|
tkVariant:
|
|
variant_init(PVarData(Data)^);
|
|
variant_init(PVarData(Data)^);
|
|
@@ -228,7 +175,6 @@ begin
|
|
tkObject,
|
|
tkObject,
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
tkRecord:
|
|
tkRecord:
|
|
-{$ifndef VER3_0}
|
|
|
|
{ if possible try to use more optimal initrtti }
|
|
{ if possible try to use more optimal initrtti }
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
begin
|
|
begin
|
|
@@ -236,12 +182,6 @@ begin
|
|
recordop^.Finalize(data);
|
|
recordop^.Finalize(data);
|
|
recordrtti(data,typeinfo,@int_finalize);
|
|
recordrtti(data,typeinfo,@int_finalize);
|
|
end;
|
|
end;
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
|
|
|
|
- recordrtti(data,typeinfo,@int_finalize);
|
|
|
|
- end;
|
|
|
|
-{$endif VER3_0}
|
|
|
|
{$ifdef FPC_HAS_FEATURE_CLASSES}
|
|
{$ifdef FPC_HAS_FEATURE_CLASSES}
|
|
tkInterface:
|
|
tkInterface:
|
|
Intf_Decr_Ref(PPointer(Data)^);
|
|
Intf_Decr_Ref(PPointer(Data)^);
|
|
@@ -279,7 +219,6 @@ begin
|
|
tkobject,
|
|
tkobject,
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
tkrecord :
|
|
tkrecord :
|
|
-{$ifndef VER3_0}
|
|
|
|
{ find init table }
|
|
{ find init table }
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
begin
|
|
begin
|
|
@@ -287,12 +226,6 @@ begin
|
|
if Assigned(recordop) and Assigned(recordop^.AddRef) then
|
|
if Assigned(recordop) and Assigned(recordop^.AddRef) then
|
|
recordop^.AddRef(Data);
|
|
recordop^.AddRef(Data);
|
|
end;
|
|
end;
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- typeinfo:=RTTIRecordRttiInfoToInitInfo(typeinfo);
|
|
|
|
- recordrtti(data,typeinfo,@int_addref);
|
|
|
|
- end;
|
|
|
|
-{$endif VER3_0}
|
|
|
|
{$ifdef FPC_HAS_FEATURE_DYNARRAYS}
|
|
{$ifdef FPC_HAS_FEATURE_DYNARRAYS}
|
|
tkDynArray:
|
|
tkDynArray:
|
|
fpc_dynarray_incr_ref(PPointer(Data)^);
|
|
fpc_dynarray_incr_ref(PPointer(Data)^);
|
|
@@ -338,17 +271,13 @@ begin
|
|
{$endif FPC_HAS_FEATURE_WIDESTRINGS}
|
|
{$endif FPC_HAS_FEATURE_WIDESTRINGS}
|
|
tkArray:
|
|
tkArray:
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- Temp:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
Result:=PArrayInfo(Temp)^.Size;
|
|
Result:=PArrayInfo(Temp)^.Size;
|
|
EleCount:=PArrayInfo(Temp)^.ElCount;
|
|
EleCount:=PArrayInfo(Temp)^.ElCount;
|
|
{ no elements to process => exit }
|
|
{ no elements to process => exit }
|
|
if EleCount = 0 then
|
|
if EleCount = 0 then
|
|
Exit;
|
|
Exit;
|
|
- Info:=PArrayInfo(Temp)^.ElInfo{$ifndef VER3_0}^{$endif};
|
|
|
|
|
|
+ Info:=PArrayInfo(Temp)^.ElInfo^;
|
|
copiedsize:=Result div EleCount;
|
|
copiedsize:=Result div EleCount;
|
|
Offset:=0;
|
|
Offset:=0;
|
|
{ Process elements }
|
|
{ Process elements }
|
|
@@ -362,18 +291,10 @@ begin
|
|
tkobject,
|
|
tkobject,
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
{$endif FPC_HAS_FEATURE_OBJECTS}
|
|
tkrecord:
|
|
tkrecord:
|
|
-{$ifndef VER3_0}
|
|
|
|
{ find init table }
|
|
{ find init table }
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
with RTTIRecordOp(typeinfo, typeinfo)^ do
|
|
-{$endif VER3_0}
|
|
|
|
begin
|
|
begin
|
|
-{$ifdef VER3_0}
|
|
|
|
- typeInfo:=RTTIRecordRttiInfoToInitInfo(typeInfo);
|
|
|
|
- Temp:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
|
|
|
|
-{$else VER3_0}
|
|
|
|
Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
Temp:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
|
|
-{$endif VER3_0}
|
|
|
|
-{$ifndef VER3_0}
|
|
|
|
if Assigned(recordop) and Assigned(recordop^.Copy) then
|
|
if Assigned(recordop) and Assigned(recordop^.Copy) then
|
|
begin
|
|
begin
|
|
recordop^.Copy(Src,Dest);
|
|
recordop^.Copy(Src,Dest);
|
|
@@ -385,17 +306,11 @@ begin
|
|
EleCount:=PRecordInfoInit(Temp)^.Count;
|
|
EleCount:=PRecordInfoInit(Temp)^.Count;
|
|
{ Get element info, hacky, but what else can we do? }
|
|
{ Get element info, hacky, but what else can we do? }
|
|
Temp:=AlignTypeData(Pointer(@PRecordInfoInit(Temp)^.Count)+SizeOf(PRecordInfoInit(Temp)^.Count));
|
|
Temp:=AlignTypeData(Pointer(@PRecordInfoInit(Temp)^.Count)+SizeOf(PRecordInfoInit(Temp)^.Count));
|
|
-{$else VER3_0}
|
|
|
|
- Result:=PRecordInfoFull(Temp)^.Size;
|
|
|
|
- EleCount:=PRecordInfoFull(Temp)^.Count;
|
|
|
|
- { Get element info, hacky, but what else can we do? }
|
|
|
|
- Temp:=Pointer(@PRecordInfoFull(Temp)^.Count)+SizeOf(PRecordInfoFull(Temp)^.Count);
|
|
|
|
-{$endif VER3_0}
|
|
|
|
expectedoffset:=0;
|
|
expectedoffset:=0;
|
|
{ Process elements with rtti }
|
|
{ Process elements with rtti }
|
|
for i:=1 to EleCount Do
|
|
for i:=1 to EleCount Do
|
|
begin
|
|
begin
|
|
- Info:=PRecordElement(Temp)^.TypeInfo{$ifndef VER3_0}^{$endif};
|
|
|
|
|
|
+ Info:=PRecordElement(Temp)^.TypeInfo^;
|
|
Offset:=PRecordElement(Temp)^.Offset;
|
|
Offset:=PRecordElement(Temp)^.Offset;
|
|
Inc(PRecordElement(Temp));
|
|
Inc(PRecordElement(Temp));
|
|
if Offset>expectedoffset then
|
|
if Offset>expectedoffset then
|
|
@@ -406,9 +321,7 @@ begin
|
|
{ elements remaining? }
|
|
{ elements remaining? }
|
|
if result>expectedoffset then
|
|
if result>expectedoffset then
|
|
move((Src+expectedoffset)^,(Dest+expectedoffset)^,Result-expectedoffset);
|
|
move((Src+expectedoffset)^,(Dest+expectedoffset)^,Result-expectedoffset);
|
|
-{$ifndef VER3_0}
|
|
|
|
end;
|
|
end;
|
|
-{$endif VER3_0}
|
|
|
|
end;
|
|
end;
|
|
{$ifdef FPC_HAS_FEATURE_DYNARRAYS}
|
|
{$ifdef FPC_HAS_FEATURE_DYNARRAYS}
|
|
tkDynArray:
|
|
tkDynArray:
|
|
@@ -441,16 +354,10 @@ end;
|
|
procedure fpc_initialize_array(data,typeinfo : pointer;count : SizeInt); [public,alias:'FPC_INITIALIZE_ARRAY']; compilerproc;
|
|
procedure fpc_initialize_array(data,typeinfo : pointer;count : SizeInt); [public,alias:'FPC_INITIALIZE_ARRAY']; compilerproc;
|
|
var
|
|
var
|
|
i, size : SizeInt;
|
|
i, size : SizeInt;
|
|
-{$ifndef VER3_0}
|
|
|
|
hasManagementOp: boolean;
|
|
hasManagementOp: boolean;
|
|
begin
|
|
begin
|
|
size:=RTTISizeAndOp(typeinfo, rotInitialize, hasManagementOp);
|
|
size:=RTTISizeAndOp(typeinfo, rotInitialize, hasManagementOp);
|
|
if (size>0) or hasManagementOp then
|
|
if (size>0) or hasManagementOp then
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- size:=RTTISize(typeInfo);
|
|
|
|
- if size>0 then
|
|
|
|
-{$endif VER3_0}
|
|
|
|
for i:=0 to count-1 do
|
|
for i:=0 to count-1 do
|
|
int_initialize(data+size*i,typeinfo);
|
|
int_initialize(data+size*i,typeinfo);
|
|
end;
|
|
end;
|
|
@@ -459,16 +366,10 @@ procedure fpc_initialize_array(data,typeinfo : pointer;count : SizeInt); [public
|
|
procedure fpc_finalize_array(data,typeinfo : pointer;count : SizeInt); [Public,Alias:'FPC_FINALIZE_ARRAY']; compilerproc;
|
|
procedure fpc_finalize_array(data,typeinfo : pointer;count : SizeInt); [Public,Alias:'FPC_FINALIZE_ARRAY']; compilerproc;
|
|
var
|
|
var
|
|
i, size: SizeInt;
|
|
i, size: SizeInt;
|
|
-{$ifndef VER3_0}
|
|
|
|
hasManagementOp: boolean;
|
|
hasManagementOp: boolean;
|
|
begin
|
|
begin
|
|
size:=RTTISizeAndOp(typeinfo, rotFinalize, hasManagementOp);
|
|
size:=RTTISizeAndOp(typeinfo, rotFinalize, hasManagementOp);
|
|
if (size>0) or hasManagementOp then
|
|
if (size>0) or hasManagementOp then
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- size:=RTTISize(typeInfo);
|
|
|
|
- if size>0 then
|
|
|
|
-{$endif VER3_0}
|
|
|
|
for i:=0 to count-1 do
|
|
for i:=0 to count-1 do
|
|
int_finalize(data+size*i,typeinfo);
|
|
int_finalize(data+size*i,typeinfo);
|
|
end;
|
|
end;
|
|
@@ -477,16 +378,10 @@ procedure fpc_finalize_array(data,typeinfo : pointer;count : SizeInt); [Public,A
|
|
procedure fpc_addref_array(data,typeinfo: pointer; count: SizeInt); [public,alias:'FPC_ADDREF_ARRAY']; compilerproc;
|
|
procedure fpc_addref_array(data,typeinfo: pointer; count: SizeInt); [public,alias:'FPC_ADDREF_ARRAY']; compilerproc;
|
|
var
|
|
var
|
|
i, size: SizeInt;
|
|
i, size: SizeInt;
|
|
-{$ifndef VER3_0}
|
|
|
|
hasManagementOp: boolean;
|
|
hasManagementOp: boolean;
|
|
begin
|
|
begin
|
|
size:=RTTISizeAndOp(typeinfo, rotAddRef, hasManagementOp);
|
|
size:=RTTISizeAndOp(typeinfo, rotAddRef, hasManagementOp);
|
|
if (size>0) or hasManagementOp then
|
|
if (size>0) or hasManagementOp then
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- size:=RTTISize(typeInfo);
|
|
|
|
- if size>0 then
|
|
|
|
-{$endif VER3_0}
|
|
|
|
for i:=0 to count-1 do
|
|
for i:=0 to count-1 do
|
|
int_addref(data+size*i,typeinfo);
|
|
int_addref(data+size*i,typeinfo);
|
|
end;
|
|
end;
|
|
@@ -511,16 +406,10 @@ procedure FinalizeArray(p, typeInfo: Pointer; count: SizeInt);
|
|
procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
|
|
procedure CopyArray(dest, source, typeInfo: Pointer; count: SizeInt);
|
|
var
|
|
var
|
|
i, size: SizeInt;
|
|
i, size: SizeInt;
|
|
-{$ifndef VER3_0}
|
|
|
|
hasManagementOp: boolean;
|
|
hasManagementOp: boolean;
|
|
begin
|
|
begin
|
|
size:=RTTISizeAndOp(typeinfo, rotCopy, hasManagementOp);
|
|
size:=RTTISizeAndOp(typeinfo, rotCopy, hasManagementOp);
|
|
if (size>0) or hasManagementOp then
|
|
if (size>0) or hasManagementOp then
|
|
-{$else VER3_0}
|
|
|
|
- begin
|
|
|
|
- size:=RTTISize(typeInfo);
|
|
|
|
- if size>0 then
|
|
|
|
-{$endif VER3_0}
|
|
|
|
for i:=0 to count-1 do
|
|
for i:=0 to count-1 do
|
|
fpc_Copy_internal(source+size*i, dest+size*i, typeInfo);
|
|
fpc_Copy_internal(source+size*i, dest+size*i, typeInfo);
|
|
end;
|
|
end;
|