Prechádzať zdrojové kódy

* change declaration of TTypeList from a static array to a pointer to T as the static array might breach the
limits for static arrays if the used type is too large (especially on 32-bit systems); as FPC supports indexing
of typed pointers like arrays this should be mostly backwards compatible

git-svn-id: trunk@39464 -

svenbarth 7 rokov pred
rodič
commit
2ec7a5acff
1 zmenil súbory, kde vykonal 6 pridanie a 6 odobranie
  1. 6 6
      rtl/objpas/fgl.pp

+ 6 - 6
rtl/objpas/fgl.pp

@@ -117,9 +117,9 @@ type
   private
     type
       TCompareFunc = function(const Item1, Item2: T): Integer;
-      TTypeList = array[0..MaxGListSize] of T;
-      PTypeList = ^TTypeList;
       PT = ^T;
+      TTypeList = PT;
+      PTypeList = ^TTypeList;
   {$ifndef OldSyntax}protected var{$else}var protected{$endif}
       FOnCompare: TCompareFunc;
     procedure CopyItem(Src, Dest: Pointer); override;
@@ -157,9 +157,9 @@ type
   private
     type
       TCompareFunc = function(const Item1, Item2: T): Integer;
-      TTypeList = array[0..MaxGListSize] of T;
-      PTypeList = ^TTypeList;
       PT = ^T;
+      TTypeList = PT;
+      PTypeList = ^TTypeList;
       TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
   {$ifndef OldSyntax}protected var{$else}var protected{$endif}
       FOnCompare: TCompareFunc;
@@ -198,9 +198,9 @@ type
   private
     type
       TCompareFunc = function(const Item1, Item2: T): Integer;
-      TTypeList = array[0..MaxGListSize] of T;
-      PTypeList = ^TTypeList;
       PT = ^T;
+      TTypeList = PT;
+      PTypeList = ^TTypeList;
       TFPGListEnumeratorSpec = specialize TFPGListEnumerator<T>;
   {$ifndef OldSyntax}protected var{$else}var protected{$endif}
       FOnCompare: TCompareFunc;