Вы всегда можете переосмыслить память.
type
TListHack<T> = class(TEnumerable<T>)
private
FItems: array of T;
FCount: Integer;
public
class procedure FastAdd(Source, Dest: TList<T>);
end;
{ TListHack<T> }
class procedure TListHack<T>.FastAdd(Source, Dest: TList<T>);
var
SourceHack: TListHack<T>;
DestHack: TListHack<T>;
TI: PTypeInfo;
begin
TI := TypeInfo(T);
if not (TI.Kind in [tkInteger, tkChar, tkFloat,
tkSet, tkClass, tkMethod, tkWChar, tkInt64, tkClassRef, tkPointer, tkProcedure]) then
raise Exception.CreateFmt('Type %s is not supported', [TI.Name]);
if Source.Count = 0 then
Exit;
DestHack := TListHack<T>(Dest);
SourceHack := TListHack<T>(Source);
if Dest.Capacity < Dest.Count + Source.Count then
Dest.Capacity := Dest.Count + Source.Count;
Move(SourceHack.FItems[0], DestHack.FItems[Dest.Count], Source.Count * SizeOf(T));
DestHack.FCount := DestHack.FCount + Source.Count;
end;
procedure TForm6.FormCreate(Sender: TObject);
var
Source, Dest: TList<Integer>;
Arr: TArray<Integer>;
begin
Source := TList<Integer>.Create;
Dest := TList<Integer>.Create;
try
Source.Add(1); Source.Add(2); Source.Add(3);
Dest.Add(10);
TListHack<Integer>.FastAdd(Source, Dest);
Assert(Dest.Count = 4);
ShowMessageFmt('%d, %d, %d, %d', [Dest[0], Dest[1], Dest[2], Dest[3]]);
finally
Source.Free; Dest.Free;
end;
TListHack<IUnknown>.FastAdd(TList<IUnknown>.Create, TLIst<IUnknown>.Create); // exception
end;
Но это очень опасно