View Issue Details

IDProjectCategoryView StatusLast Update
0033921FPCRTLpublic2018-06-29 22:49
ReporterMaciej IzakAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0033921: Generics.Collections June update
DescriptionThe patch includes latest changes from original library :

* Unified code base between FPC trunk, library and NewPascal. Previously trunk was priority, so there was some minor differences between FPC trunk version, github repo and NewPascal version. Now the order is : library on github > NewPascal > FPC trunk
* Reworked patch and reworked test from Michalis Kamburelis for xxHash32 pure pascal version (problem highly visible for MacOS version and for non Intel CPUs), fix issue 9 in github issues
* link to proper bugtracker for bugs related to this library : https://github.com/maciej-izak/generics.collections/issues
* update for inactive freesparta.com links (newpascal.org is used instead of freesparta.com)
* some new proper credits in few places
* basic information why this library in FPC trunk is not up to date
TagsNo tags attached.
Fixed in Revision39345
FPCOldBugId0
FPCTarget
Attached Files
  • rtl-generics.june.patch (45,972 bytes)
    From 87ec06f020c83a21b8c1fa16642f7a2865b98053 Mon Sep 17 00:00:00 2001
    From: maciej-izak <hnb.code@gmail.com>
    Date: Wed, 27 Jun 2018 22:35:14 +0200
    Subject: [PATCH] * Cleanup ifdefs order * Update for examples (copyright and
     links to NewPascal.org and github bugtracker) * Reworked patch and test from
     Michalis Kamburelis for xxHash32 pure pascal version (problem highly visible
     for MacOS version and for non Intel CPUs), fix #9 * Update for all files with
     new info "how to report bugs and where" (also copyright header is updated)
    
    ---
     .../examples/tarraydouble/tarrayprojectdouble.lpr  |   3 +-
     .../examples/tarraysingle/tarrayprojectsingle.lpr  |   3 +-
     .../examples/tcomparer/tcomparerproject.lpr        |   3 +-
     .../examples/thashmap/thashmapproject.lpr          |   3 +-
     .../thashmapcaseinsensitive.lpr                    |   3 +-
     .../thashmapextendedequalitycomparer.lpr           |   3 +-
     .../examples/thashset/thashset_exceptwith.lpr      |   5 +
     .../examples/thashset/thashset_intersectwith.lpr   |   5 +
     .../thashset/thashset_symmetricexceptwith.lpr      |   5 +
     .../examples/thashset/thashset_unionwith.lpr       |   5 +
     .../examples/tobjectlist/tobjectlistproject.lpr    |   3 +-
     .../rtl-generics/examples/tqueue/tqueueproject.lpr |   3 +-
     .../rtl-generics/examples/tstack/tstackproject.lpr |   4 +-
     packages/rtl-generics/src/generics.collections.pas |  25 ++++-
     packages/rtl-generics/src/generics.defaults.pas    |  69 ++++++++++++-
     packages/rtl-generics/src/generics.hashes.pas      | 110 +++++++++++++--------
     packages/rtl-generics/src/generics.helpers.pas     |  25 ++++-
     .../rtl-generics/src/generics.memoryexpanders.pas  |  25 ++++-
     packages/rtl-generics/src/generics.strings.pas     |  25 ++++-
     .../rtl-generics/src/inc/generics.dictionaries.inc |  25 ++++-
     .../src/inc/generics.dictionariesh.inc             |  25 ++++-
     .../tests/tests.generics.arrayhelper.pas           |  23 ++++-
     .../rtl-generics/tests/tests.generics.bugs.pas     |  24 ++++-
     .../rtl-generics/tests/tests.generics.hashmaps.pas |  65 +++++++++++-
     .../rtl-generics/tests/tests.generics.sets.pas     |  24 ++++-
     .../tests/tests.generics.stdcollections.pas        |  23 ++++-
     .../rtl-generics/tests/tests.generics.trees.pas    |  23 ++++-
     .../rtl-generics/tests/tests.generics.utils.pas    |  35 +++++++
     28 files changed, 504 insertions(+), 90 deletions(-)
    
    diff --git a/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr b/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
    index 8ed5c2b..2b0c7ae 100644
    --- a/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
    +++ b/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
    @@ -1,6 +1,7 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program TArrayProjectDouble;
     
    diff --git a/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr b/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
    index 49bec2c..14316e0 100644
    --- a/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
    +++ b/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
    @@ -1,6 +1,7 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program TArrayProjectSingle;
     
    diff --git a/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr b/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
    index b7c1282..798ce4a 100644
    --- a/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
    +++ b/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
    @@ -1,5 +1,6 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program TComparerProject;
     
    diff --git a/packages/rtl-generics/examples/thashmap/thashmapproject.lpr b/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
    index d9598ca..9cb76f0 100644
    --- a/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
    +++ b/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
    @@ -1,6 +1,7 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program THashMapProject;
     
    diff --git a/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr b/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
    index 377bd69..191db64 100644
    --- a/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
    +++ b/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
    @@ -1,5 +1,6 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program THashMapCaseInsensitive;
     
    diff --git a/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr b/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
    index d3c9116..88acde6 100644
    --- a/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
    +++ b/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
    @@ -1,5 +1,6 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program THashMapExtendedEqualityComparer;
     
    diff --git a/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr b/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
    index 8331d95..c88e86b 100644
    --- a/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
    +++ b/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
    @@ -1,3 +1,8 @@
    +// Generic types for NewPascal.org and FPC!
    +// by Maciej Izak (hnb), 2018
    +// sponsored by Sphere 10 Software (http://sphere10.com)
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
    +
     program thashset_exceptwith;
     
     {$MODE DELPHI}
    diff --git a/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr b/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
    index 51771e2..a9e9cb9 100644
    --- a/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
    +++ b/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
    @@ -1,3 +1,8 @@
    +// Generic types for NewPascal.org and FPC!
    +// by Maciej Izak (hnb), 2018
    +// sponsored by Sphere 10 Software (http://sphere10.com)
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
    +
     program thashset_intersectwith;
     
     {$MODE DELPHI}
    diff --git a/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr b/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
    index 5b29e13..3e843f6 100644
    --- a/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
    +++ b/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
    @@ -1,3 +1,8 @@
    +// Generic types for NewPascal.org and FPC!
    +// by Maciej Izak (hnb), 2018
    +// sponsored by Sphere 10 Software (http://sphere10.com)
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
    +
     program thashset_symmetricexceptwith;
     
     {$MODE DELPHI}
    diff --git a/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr b/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
    index 90b7e68..476ff1d 100644
    --- a/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
    +++ b/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
    @@ -1,3 +1,8 @@
    +// Generic types for NewPascal.org and FPC!
    +// by Maciej Izak (hnb), 2018
    +// sponsored by Sphere 10 Software (http://sphere10.com)
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
    +
     program thashset_unionwith;
     
     {$MODE DELPHI}
    diff --git a/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr b/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
    index 179d885..54276a6 100644
    --- a/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
    +++ b/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
    @@ -1,6 +1,7 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program TObjectListProject;
     
    diff --git a/packages/rtl-generics/examples/tqueue/tqueueproject.lpr b/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
    index 87e51cd..393cdee 100644
    --- a/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
    +++ b/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
    @@ -1,6 +1,7 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
     
     program TQueueProject;
     
    diff --git a/packages/rtl-generics/examples/tstack/tstackproject.lpr b/packages/rtl-generics/examples/tstack/tstackproject.lpr
    index a6ddad9..ef684c9 100644
    --- a/packages/rtl-generics/examples/tstack/tstackproject.lpr
    +++ b/packages/rtl-generics/examples/tstack/tstackproject.lpr
    @@ -1,6 +1,8 @@
    -// Generic types for FreeSparta.com and FreePascal!
    +// Generic types for NewPascal.org and FPC!
     // Original version by keeper89.blogspot.com, 2011
     // FPC version by Maciej Izak (hnb), 2014
    +// bug reports : https://github.com/maciej-izak/generics.collections/issues
    +
     program TStackProject;
     
     {$MODE DELPHI}
    diff --git a/packages/rtl-generics/src/generics.collections.pas b/packages/rtl-generics/src/generics.collections.pas
    index 907f6ac..3b80bfe 100644
    --- a/packages/rtl-generics/src/generics.collections.pas
    +++ b/packages/rtl-generics/src/generics.collections.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -22,6 +22,23 @@
         Thanks to mORMot (http://synopse.info) project for the best implementations
         of hashing functions like crc32c and xxHash32 :)
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.Collections;
    diff --git a/packages/rtl-generics/src/generics.defaults.pas b/packages/rtl-generics/src/generics.defaults.pas
    index 3259d65..23d6208 100644
    --- a/packages/rtl-generics/src/generics.defaults.pas
    +++ b/packages/rtl-generics/src/generics.defaults.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -22,6 +22,23 @@
         Thanks to mORMot (http://synopse.info) project for the best implementations
         of hashing functions like crc32c and xxHash32 :)
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.Defaults;
    @@ -865,12 +882,30 @@ type
         class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
       end;
     
    +  { TmORMotHashFactory }
    +
       TmORMotHashFactory = class(THashFactory)
       public
         class function GetHashService: THashServiceClass; override;
         class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
       end;
     
    +  { TxxHash32HashFactory }
    +
    +  TxxHash32HashFactory = class(THashFactory)
    +  public
    +    class function GetHashService: THashServiceClass; override;
    +    class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
    +  end;
    +
    +  { TxxHash32PascalHashFactory }
    +
    +  TxxHash32PascalHashFactory = class(THashFactory)
    +  public
    +    class function GetHashService: THashServiceClass; override;
    +    class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
    +  end;
    +
       { TAdler32HashFactory }
     
       TAdler32HashFactory = class(THashFactory)
    @@ -2808,6 +2843,32 @@ begin
       Result := mORMotHasher(AInitVal, AKey, ASize);
     end;
     
    +{ TxxHash32HashFactory }
    +
    +class function TxxHash32HashFactory.GetHashService: THashServiceClass;
    +begin
    +  Result := THashService<TxxHash32HashFactory>;
    +end;
    +
    +class function TxxHash32HashFactory.GetHashCode(AKey: Pointer; ASize: SizeInt;
    +  AInitVal: UInt32): UInt32;
    +begin
    +  Result := xxHash32(AInitVal, AKey, ASize);
    +end;
    +
    +{ TxxHash32PascalHashFactory }
    +
    +class function TxxHash32PascalHashFactory.GetHashService: THashServiceClass;
    +begin
    +  Result := THashService<TxxHash32PascalHashFactory>;
    +end;
    +
    +class function TxxHash32PascalHashFactory.GetHashCode(AKey: Pointer; ASize: SizeInt;
    +  AInitVal: UInt32): UInt32;
    +begin
    +  Result := xxHash32Pascal(AInitVal, AKey, ASize);
    +end;
    +
     { TAdler32HashFactory }
     
     class function TAdler32HashFactory.GetHashService: THashServiceClass;
    diff --git a/packages/rtl-generics/src/generics.hashes.pas b/packages/rtl-generics/src/generics.hashes.pas
    index fd656b8..03afa39 100644
    --- a/packages/rtl-generics/src/generics.hashes.pas
    +++ b/packages/rtl-generics/src/generics.hashes.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -22,6 +22,23 @@
         Thanks to mORMot (http://synopse.info) project for the best implementations
         of hashing functions like crc32c and xxHash32 :)
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.Hashes;
    @@ -33,6 +50,37 @@ unit Generics.Hashes;
     {$OVERFLOWCHECKS OFF}
     {$RANGECHECKS OFF}
     
    +{$ifdef FPC_PIC}
    +  {$define DISABLE_X86_CPUINTEL}
    +{$endif FPC_PIC}
    +
    +{$if defined(OPENBSD) or defined(EMX) or defined(OS2)}
    +  { These targets have old GNU assemblers that }
    +  { do not support all instructions used in assembler code below }
    +  {$define DISABLE_X86_CPUINTEL}
    +{$endif}
    +
    +{$ifdef CPU64}
    +  {$define PUREPASCAL}
    +  {$ifdef CPUX64}
    +    {$define CPUINTEL}
    +    {$ASMMODE INTEL}
    +  {$endif CPUX64}
    +{$else}
    +  {$ifdef CPUX86}
    +    {$ifndef DISABLE_X86_CPUINTEL}
    +      {$define CPUINTEL}
    +      {$ASMMODE INTEL}
    +    {$else}
    +      { Assembler code uses references to static
    +        variables with are not PIC ready }
    +      {$define PUREPASCAL}
    +    {$endif}
    +  {$else CPUX86}
    +  {$define PUREPASCAL}
    +  {$endif}
    +{$endif CPU64}
    +
     interface
     
     uses
    @@ -72,7 +120,9 @@ function SimpleChecksumHash(AKey: Pointer; ALength: SizeInt): UInt32;
     // https://code.google.com/p/hedgewars/source/browse/hedgewars/adler32.pas
     function Adler32(AKey: Pointer; ALength: SizeInt): UInt32;
     function sdbm(AKey: Pointer; ALength: SizeInt): UInt32;
    -function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
    +function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;{$IFNDEF CPUINTEL}inline;{$ENDIF}
    +// pure pascal implementation of xxHash32
    +function xxHash32Pascal(crc: cardinal; P: Pointer; len: integer): cardinal;
     
     type
       THasher = function(crc: cardinal; buf: Pointer; len: cardinal): cardinal;
    @@ -927,37 +977,6 @@ begin
       Result := Int32(c);
     end;
     
    -{$ifdef FPC_PIC}
    -  {$define DISABLE_X86_CPUINTEL}
    -{$endif FPC_PIC}
    -
    -{$if defined(OPENBSD) or defined(EMX) or defined(OS2)}
    -  { These targets have old GNU assemblers that }
    -  { do not support all instructions used in assembler code below }
    -  {$define DISABLE_X86_CPUINTEL}
    -{$endif}
    -
    -{$ifdef CPU64}
    -  {$define PUREPASCAL}
    -  {$ifdef CPUX64}
    -    {$define CPUINTEL}
    -    {$ASMMODE INTEL}
    -  {$endif CPUX64}
    -{$else}
    -  {$ifdef CPUX86}
    -    {$ifndef DISABLE_X86_CPUINTEL}
    -      {$define CPUINTEL}
    -      {$ASMMODE INTEL}
    -    {$else}
    -      { Assembler code uses references to static
    -        variables with are not PIC ready }
    -      {$define PUREPASCAL}
    -    {$endif}
    -  {$else CPUX86}
    -  {$define PUREPASCAL}
    -  {$endif}
    -{$endif CPU64}
    -
     {$ifdef CPUARM} // circumvent FPC issue on ARM
     function ToByte(value: cardinal): cardinal; inline;
     begin
    @@ -1166,8 +1185,13 @@ asm
             {$endif}
     end;
     {$endif CPUX64}
    -
     {$else not CPUINTEL}
    +function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
    +begin
    +  result := xxHash32Pascal(crc, P, len);
    +end;
    +{$endif CPUINTEL}
    +
     const
       PRIME32_1 = 2654435761;
       PRIME32_2 = 2246822519;
    @@ -1181,7 +1205,7 @@ begin
       result := RolDWord(value, 13);
     end;
     
    -function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
    +function xxHash32Pascal(crc: cardinal; P: Pointer; len: integer): cardinal;
     var c1, c2, c3, c4: cardinal;
         PLimit, PEnd: PAnsiChar;
     begin
    @@ -1203,7 +1227,12 @@ begin
       end else
         result := crc + PRIME32_5;
       inc(result, len);
    -  while P <= PEnd - 4 do begin
    +  { Use "P + 4 <= PEnd" instead of "P <= PEnd - 4" to avoid crashes in case P = nil.
    +    When P = nil,
    +    then "PtrUInt(PEnd - 4)" is 4294967292,
    +    so the condition "P <= PEnd - 4" would be satisfied,
    +    and the code would try to access PCardinal(nil)^ causing a SEGFAULT. }
    +  while P + 4 <= PEnd do begin
         inc(result, PCardinal(P)^ * PRIME32_3);
         result := RolDWord(result, 17) * PRIME32_4;
         inc(P, 4);
    @@ -1219,7 +1248,6 @@ begin
       result := result * PRIME32_3;
       result := result xor (result shr 16);
     end;
    -{$endif CPUINTEL}
     
     {$ifdef CPUINTEL}
     
    @@ -1593,7 +1621,7 @@ begin
       begin
         InitializeCrc32ctab;
         crc32c := @crc32cfast;
    -    mORMotHasher := @xxHash32;
    +    mORMotHasher := @{$IFDEF CPUINTEL}xxHash32{$ELSE}xxHash32Pascal{$ENDIF};
       end;
     end.
     
    diff --git a/packages/rtl-generics/src/generics.helpers.pas b/packages/rtl-generics/src/generics.helpers.pas
    index a03cf88..443e4a8 100644
    --- a/packages/rtl-generics/src/generics.helpers.pas
    +++ b/packages/rtl-generics/src/generics.helpers.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -14,6 +14,23 @@
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.Helpers;
    diff --git a/packages/rtl-generics/src/generics.memoryexpanders.pas b/packages/rtl-generics/src/generics.memoryexpanders.pas
    index 77acbf4..6dc4ab9 100644
    --- a/packages/rtl-generics/src/generics.memoryexpanders.pas
    +++ b/packages/rtl-generics/src/generics.memoryexpanders.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -14,6 +14,23 @@
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.MemoryExpanders;
    diff --git a/packages/rtl-generics/src/generics.strings.pas b/packages/rtl-generics/src/generics.strings.pas
    index da80e01..8e30f87 100644
    --- a/packages/rtl-generics/src/generics.strings.pas
    +++ b/packages/rtl-generics/src/generics.strings.pas
    @@ -1,11 +1,11 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -14,6 +14,23 @@
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit Generics.Strings;
    diff --git a/packages/rtl-generics/src/inc/generics.dictionaries.inc b/packages/rtl-generics/src/inc/generics.dictionaries.inc
    index 8405648..bfa8f7e 100644
    --- a/packages/rtl-generics/src/inc/generics.dictionaries.inc
    +++ b/packages/rtl-generics/src/inc/generics.dictionaries.inc
    @@ -1,13 +1,13 @@
     {%MainUnit generics.collections.pas}
     
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -24,6 +24,23 @@
         Thanks to mORMot (http://synopse.info) project for the best implementations
         of hashing functions like crc32c and xxHash32 :)
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     { TPair<TKey,TValue> }
    diff --git a/packages/rtl-generics/src/inc/generics.dictionariesh.inc b/packages/rtl-generics/src/inc/generics.dictionariesh.inc
    index e0a66db..d563d21 100644
    --- a/packages/rtl-generics/src/inc/generics.dictionariesh.inc
    +++ b/packages/rtl-generics/src/inc/generics.dictionariesh.inc
    @@ -1,13 +1,13 @@
     {%MainUnit generics.collections.pas}
     
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2014 by Maciej Izak (hnb)
    -    member of the Free Sparta development team (http://freesparta.com)
    +    member of the NewPascal development team (http://newpascal.org)
     
    -    Copyright(c) 2004-2014 DaThoX
    +    Copyright(c) 2004-2018 DaThoX
     
    -    It contains the Free Pascal generics library
    +    It contains the generics collections library
     
         See the file COPYING.FPC, included in this distribution,
         for details about the copyright.
    @@ -24,6 +24,23 @@
         Thanks to mORMot (http://synopse.info) project for the best implementations
         of hashing functions like crc32c and xxHash32 :)
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     {$WARNINGS OFF}
    diff --git a/packages/rtl-generics/tests/tests.generics.arrayhelper.pas b/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
    index f17263c..f55a438 100644
    --- a/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
    +++ b/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -17,6 +19,23 @@
         Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
         many new types, tests and major refactoring of entire library
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit tests.generics.arrayhelper;
    diff --git a/packages/rtl-generics/tests/tests.generics.bugs.pas b/packages/rtl-generics/tests/tests.generics.bugs.pas
    index 3328b23..0eac5c5 100644
    --- a/packages/rtl-generics/tests/tests.generics.bugs.pas
    +++ b/packages/rtl-generics/tests/tests.generics.bugs.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -17,7 +19,25 @@
         Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
         many new types, tests and major refactoring of entire library
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
    +
     unit tests.generics.bugs;
     
     {$mode delphi}
    diff --git a/packages/rtl-generics/tests/tests.generics.hashmaps.pas b/packages/rtl-generics/tests/tests.generics.hashmaps.pas
    index 1219d88..46af7dd 100644
    --- a/packages/rtl-generics/tests/tests.generics.hashmaps.pas
    +++ b/packages/rtl-generics/tests/tests.generics.hashmaps.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -17,6 +19,26 @@
         Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
         many new types, tests and major refactoring of entire library
     
    +    Thanks to Castle Game Engine (https://castle-engine.sourceforge.io)
    +    Part of tests for this module was copied from Castle Game Engine tests
    +
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit tests.generics.hashmaps;
    @@ -65,6 +87,8 @@ type
         procedure Test_ObjectDictionary;
     
         procedure Test_TryAddOrSetOrGetValue;
    +    procedure Test_TryGetValueEmpty_xxHash32;
    +    procedure Test_TryGetValueEmpty_xxHash32Pascal;
       end;
     
     implementation
    @@ -360,6 +384,43 @@ begin
       end;
     end;
     
    +// modified test from Castle Game Engine (https://castle-engine.io/)
    +{$DEFINE TEST_TRYGETEMPTYVALUE :=
    +  try
    +    Map.AddOrSetValue('some key', 'some value');
    +
    +    B := Map.TryGetValue('some key', V);
    +    AssertTrue(B);
    +    AssertEquals('some value', V);
    +
    +    B := Map.TryGetValue('some other key', V);
    +    AssertFalse(B);
    +
    +    B := Map.TryGetValue('', V);
    +    AssertFalse(B);
    +  finally
    +    FreeAndNil(Map)
    +  end;
    +}
    +
    +procedure TTestHashMaps.Test_TryGetValueEmpty_xxHash32;
    +var
    +  Map: TOpenAddressingLP<string, string, TxxHash32HashFactory>;
    +  V: String; B: Boolean;
    +begin
    +  Map := TOpenAddressingLP<string, string, TxxHash32HashFactory>.Create;
    +  TEST_TRYGETEMPTYVALUE;
    +end;
    +
    +procedure TTestHashMaps.Test_TryGetValueEmpty_xxHash32Pascal;
    +var
    +  Map: TOpenAddressingLP<string, string, TxxHash32PascalHashFactory>;
    +  V: String; B: Boolean;
    +begin
    +  Map := TOpenAddressingLP<string, string, TxxHash32PascalHashFactory>.Create;
    +  TEST_TRYGETEMPTYVALUE;
    +end;
    +
     begin
       RegisterTest(TTestHashMaps);
     end.
    diff --git a/packages/rtl-generics/tests/tests.generics.sets.pas b/packages/rtl-generics/tests/tests.generics.sets.pas
    index 63cfbfa..2a4c633 100644
    --- a/packages/rtl-generics/tests/tests.generics.sets.pas
    +++ b/packages/rtl-generics/tests/tests.generics.sets.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -17,7 +19,25 @@
         Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
         many new types, tests and major refactoring of entire library
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
    +
     unit tests.generics.sets;
     
     {$mode delphi}
    diff --git a/packages/rtl-generics/tests/tests.generics.stdcollections.pas b/packages/rtl-generics/tests/tests.generics.stdcollections.pas
    index e12edc6..86a6de6 100644
    --- a/packages/rtl-generics/tests/tests.generics.stdcollections.pas
    +++ b/packages/rtl-generics/tests/tests.generics.stdcollections.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -20,6 +22,23 @@
         Thanks to Castle Game Engine (https://castle-engine.sourceforge.io)
         Part of tests for this module was copied from Castle Game Engine tests
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit tests.generics.stdcollections;
    diff --git a/packages/rtl-generics/tests/tests.generics.trees.pas b/packages/rtl-generics/tests/tests.generics.trees.pas
    index 415c36d..0adc726 100644
    --- a/packages/rtl-generics/tests/tests.generics.trees.pas
    +++ b/packages/rtl-generics/tests/tests.generics.trees.pas
    @@ -1,7 +1,9 @@
     {
    -    This file is part of the Free Pascal run time library.
    +    This file is part of the Free Pascal/NewPascal run time library.
         Copyright (c) 2018 by Maciej Izak (hnb),
    -    member of the Free Pascal development team
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
     
         It contains tests for the Free Pascal generics library
     
    @@ -17,6 +19,23 @@
         Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
         many new types, tests and major refactoring of entire library
     
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
      **********************************************************************}
     
     unit tests.generics.trees;
    diff --git a/packages/rtl-generics/tests/tests.generics.utils.pas b/packages/rtl-generics/tests/tests.generics.utils.pas
    index 1572c85..50bb84d 100644
    --- a/packages/rtl-generics/tests/tests.generics.utils.pas
    +++ b/packages/rtl-generics/tests/tests.generics.utils.pas
    @@ -1,3 +1,38 @@
    +{
    +    This file is part of the Free Pascal/NewPascal run time library.
    +    Copyright (c) 2014 by Maciej Izak (hnb)
    +    member of the NewPascal development team (http://newpascal.org)
    +
    +    Copyright(c) 2004-2018 DaThoX
    +
    +    It contains tests for the Free Pascal generics library
    +
    +    See the file COPYING.FPC, included in this distribution,
    +    for details about the copyright.
    +
    +    This program is distributed in the hope that it will be useful,
    +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    +
    + **********************************************************************
    +
    + !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
    +
    + author of this library has no access to FPC trunk anymore, so every problem
    + related to this library should be reported here :
    +
    + https://github.com/maciej-izak/generics.collections/issues
    +
    + The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
    + (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
    + Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
    +
    + The NewPascal has special support for this library, more recent version (more 
    + bug fixes), more optimizations and better support from compiler side 
    + (NewPascal contains modified/extended FPC compiler version).
    +
    + **********************************************************************}
    +
     unit tests.generics.utils;
     
     {$mode delphi}
    -- 
    2.9.3.windows.2
    
    
    rtl-generics.june.patch (45,972 bytes)

Activities

Maciej Izak

2018-06-28 08:40

reporter  

rtl-generics.june.patch (45,972 bytes)
From 87ec06f020c83a21b8c1fa16642f7a2865b98053 Mon Sep 17 00:00:00 2001
From: maciej-izak <hnb.code@gmail.com>
Date: Wed, 27 Jun 2018 22:35:14 +0200
Subject: [PATCH] * Cleanup ifdefs order * Update for examples (copyright and
 links to NewPascal.org and github bugtracker) * Reworked patch and test from
 Michalis Kamburelis for xxHash32 pure pascal version (problem highly visible
 for MacOS version and for non Intel CPUs), fix #9 * Update for all files with
 new info "how to report bugs and where" (also copyright header is updated)

---
 .../examples/tarraydouble/tarrayprojectdouble.lpr  |   3 +-
 .../examples/tarraysingle/tarrayprojectsingle.lpr  |   3 +-
 .../examples/tcomparer/tcomparerproject.lpr        |   3 +-
 .../examples/thashmap/thashmapproject.lpr          |   3 +-
 .../thashmapcaseinsensitive.lpr                    |   3 +-
 .../thashmapextendedequalitycomparer.lpr           |   3 +-
 .../examples/thashset/thashset_exceptwith.lpr      |   5 +
 .../examples/thashset/thashset_intersectwith.lpr   |   5 +
 .../thashset/thashset_symmetricexceptwith.lpr      |   5 +
 .../examples/thashset/thashset_unionwith.lpr       |   5 +
 .../examples/tobjectlist/tobjectlistproject.lpr    |   3 +-
 .../rtl-generics/examples/tqueue/tqueueproject.lpr |   3 +-
 .../rtl-generics/examples/tstack/tstackproject.lpr |   4 +-
 packages/rtl-generics/src/generics.collections.pas |  25 ++++-
 packages/rtl-generics/src/generics.defaults.pas    |  69 ++++++++++++-
 packages/rtl-generics/src/generics.hashes.pas      | 110 +++++++++++++--------
 packages/rtl-generics/src/generics.helpers.pas     |  25 ++++-
 .../rtl-generics/src/generics.memoryexpanders.pas  |  25 ++++-
 packages/rtl-generics/src/generics.strings.pas     |  25 ++++-
 .../rtl-generics/src/inc/generics.dictionaries.inc |  25 ++++-
 .../src/inc/generics.dictionariesh.inc             |  25 ++++-
 .../tests/tests.generics.arrayhelper.pas           |  23 ++++-
 .../rtl-generics/tests/tests.generics.bugs.pas     |  24 ++++-
 .../rtl-generics/tests/tests.generics.hashmaps.pas |  65 +++++++++++-
 .../rtl-generics/tests/tests.generics.sets.pas     |  24 ++++-
 .../tests/tests.generics.stdcollections.pas        |  23 ++++-
 .../rtl-generics/tests/tests.generics.trees.pas    |  23 ++++-
 .../rtl-generics/tests/tests.generics.utils.pas    |  35 +++++++
 28 files changed, 504 insertions(+), 90 deletions(-)

diff --git a/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr b/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
index 8ed5c2b..2b0c7ae 100644
--- a/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
+++ b/packages/rtl-generics/examples/tarraydouble/tarrayprojectdouble.lpr
@@ -1,6 +1,7 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program TArrayProjectDouble;
 
diff --git a/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr b/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
index 49bec2c..14316e0 100644
--- a/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
+++ b/packages/rtl-generics/examples/tarraysingle/tarrayprojectsingle.lpr
@@ -1,6 +1,7 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program TArrayProjectSingle;
 
diff --git a/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr b/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
index b7c1282..798ce4a 100644
--- a/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
+++ b/packages/rtl-generics/examples/tcomparer/tcomparerproject.lpr
@@ -1,5 +1,6 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program TComparerProject;
 
diff --git a/packages/rtl-generics/examples/thashmap/thashmapproject.lpr b/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
index d9598ca..9cb76f0 100644
--- a/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
+++ b/packages/rtl-generics/examples/thashmap/thashmapproject.lpr
@@ -1,6 +1,7 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program THashMapProject;
 
diff --git a/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr b/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
index 377bd69..191db64 100644
--- a/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
+++ b/packages/rtl-generics/examples/thashmapcaseinsensitive/thashmapcaseinsensitive.lpr
@@ -1,5 +1,6 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program THashMapCaseInsensitive;
 
diff --git a/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr b/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
index d3c9116..88acde6 100644
--- a/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
+++ b/packages/rtl-generics/examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
@@ -1,5 +1,6 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program THashMapExtendedEqualityComparer;
 
diff --git a/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr b/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
index 8331d95..c88e86b 100644
--- a/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
+++ b/packages/rtl-generics/examples/thashset/thashset_exceptwith.lpr
@@ -1,3 +1,8 @@
+// Generic types for NewPascal.org and FPC!
+// by Maciej Izak (hnb), 2018
+// sponsored by Sphere 10 Software (http://sphere10.com)
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
+
 program thashset_exceptwith;
 
 {$MODE DELPHI}
diff --git a/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr b/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
index 51771e2..a9e9cb9 100644
--- a/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
+++ b/packages/rtl-generics/examples/thashset/thashset_intersectwith.lpr
@@ -1,3 +1,8 @@
+// Generic types for NewPascal.org and FPC!
+// by Maciej Izak (hnb), 2018
+// sponsored by Sphere 10 Software (http://sphere10.com)
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
+
 program thashset_intersectwith;
 
 {$MODE DELPHI}
diff --git a/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr b/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
index 5b29e13..3e843f6 100644
--- a/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
+++ b/packages/rtl-generics/examples/thashset/thashset_symmetricexceptwith.lpr
@@ -1,3 +1,8 @@
+// Generic types for NewPascal.org and FPC!
+// by Maciej Izak (hnb), 2018
+// sponsored by Sphere 10 Software (http://sphere10.com)
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
+
 program thashset_symmetricexceptwith;
 
 {$MODE DELPHI}
diff --git a/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr b/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
index 90b7e68..476ff1d 100644
--- a/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
+++ b/packages/rtl-generics/examples/thashset/thashset_unionwith.lpr
@@ -1,3 +1,8 @@
+// Generic types for NewPascal.org and FPC!
+// by Maciej Izak (hnb), 2018
+// sponsored by Sphere 10 Software (http://sphere10.com)
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
+
 program thashset_unionwith;
 
 {$MODE DELPHI}
diff --git a/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr b/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
index 179d885..54276a6 100644
--- a/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
+++ b/packages/rtl-generics/examples/tobjectlist/tobjectlistproject.lpr
@@ -1,6 +1,7 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program TObjectListProject;
 
diff --git a/packages/rtl-generics/examples/tqueue/tqueueproject.lpr b/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
index 87e51cd..393cdee 100644
--- a/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
+++ b/packages/rtl-generics/examples/tqueue/tqueueproject.lpr
@@ -1,6 +1,7 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
 
 program TQueueProject;
 
diff --git a/packages/rtl-generics/examples/tstack/tstackproject.lpr b/packages/rtl-generics/examples/tstack/tstackproject.lpr
index a6ddad9..ef684c9 100644
--- a/packages/rtl-generics/examples/tstack/tstackproject.lpr
+++ b/packages/rtl-generics/examples/tstack/tstackproject.lpr
@@ -1,6 +1,8 @@
-// Generic types for FreeSparta.com and FreePascal!
+// Generic types for NewPascal.org and FPC!
 // Original version by keeper89.blogspot.com, 2011
 // FPC version by Maciej Izak (hnb), 2014
+// bug reports : https://github.com/maciej-izak/generics.collections/issues
+
 program TStackProject;
 
 {$MODE DELPHI}
diff --git a/packages/rtl-generics/src/generics.collections.pas b/packages/rtl-generics/src/generics.collections.pas
index 907f6ac..3b80bfe 100644
--- a/packages/rtl-generics/src/generics.collections.pas
+++ b/packages/rtl-generics/src/generics.collections.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -22,6 +22,23 @@
     Thanks to mORMot (http://synopse.info) project for the best implementations
     of hashing functions like crc32c and xxHash32 :)
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.Collections;
diff --git a/packages/rtl-generics/src/generics.defaults.pas b/packages/rtl-generics/src/generics.defaults.pas
index 3259d65..23d6208 100644
--- a/packages/rtl-generics/src/generics.defaults.pas
+++ b/packages/rtl-generics/src/generics.defaults.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -22,6 +22,23 @@
     Thanks to mORMot (http://synopse.info) project for the best implementations
     of hashing functions like crc32c and xxHash32 :)
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.Defaults;
@@ -865,12 +882,30 @@ type
     class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
   end;
 
+  { TmORMotHashFactory }
+
   TmORMotHashFactory = class(THashFactory)
   public
     class function GetHashService: THashServiceClass; override;
     class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
   end;
 
+  { TxxHash32HashFactory }
+
+  TxxHash32HashFactory = class(THashFactory)
+  public
+    class function GetHashService: THashServiceClass; override;
+    class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
+  end;
+
+  { TxxHash32PascalHashFactory }
+
+  TxxHash32PascalHashFactory = class(THashFactory)
+  public
+    class function GetHashService: THashServiceClass; override;
+    class function GetHashCode(AKey: Pointer; ASize: SizeInt; AInitVal: UInt32 = 0): UInt32; override;
+  end;
+
   { TAdler32HashFactory }
 
   TAdler32HashFactory = class(THashFactory)
@@ -2808,6 +2843,32 @@ begin
   Result := mORMotHasher(AInitVal, AKey, ASize);
 end;
 
+{ TxxHash32HashFactory }
+
+class function TxxHash32HashFactory.GetHashService: THashServiceClass;
+begin
+  Result := THashService<TxxHash32HashFactory>;
+end;
+
+class function TxxHash32HashFactory.GetHashCode(AKey: Pointer; ASize: SizeInt;
+  AInitVal: UInt32): UInt32;
+begin
+  Result := xxHash32(AInitVal, AKey, ASize);
+end;
+
+{ TxxHash32PascalHashFactory }
+
+class function TxxHash32PascalHashFactory.GetHashService: THashServiceClass;
+begin
+  Result := THashService<TxxHash32PascalHashFactory>;
+end;
+
+class function TxxHash32PascalHashFactory.GetHashCode(AKey: Pointer; ASize: SizeInt;
+  AInitVal: UInt32): UInt32;
+begin
+  Result := xxHash32Pascal(AInitVal, AKey, ASize);
+end;
+
 { TAdler32HashFactory }
 
 class function TAdler32HashFactory.GetHashService: THashServiceClass;
diff --git a/packages/rtl-generics/src/generics.hashes.pas b/packages/rtl-generics/src/generics.hashes.pas
index fd656b8..03afa39 100644
--- a/packages/rtl-generics/src/generics.hashes.pas
+++ b/packages/rtl-generics/src/generics.hashes.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -22,6 +22,23 @@
     Thanks to mORMot (http://synopse.info) project for the best implementations
     of hashing functions like crc32c and xxHash32 :)
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.Hashes;
@@ -33,6 +50,37 @@ unit Generics.Hashes;
 {$OVERFLOWCHECKS OFF}
 {$RANGECHECKS OFF}
 
+{$ifdef FPC_PIC}
+  {$define DISABLE_X86_CPUINTEL}
+{$endif FPC_PIC}
+
+{$if defined(OPENBSD) or defined(EMX) or defined(OS2)}
+  { These targets have old GNU assemblers that }
+  { do not support all instructions used in assembler code below }
+  {$define DISABLE_X86_CPUINTEL}
+{$endif}
+
+{$ifdef CPU64}
+  {$define PUREPASCAL}
+  {$ifdef CPUX64}
+    {$define CPUINTEL}
+    {$ASMMODE INTEL}
+  {$endif CPUX64}
+{$else}
+  {$ifdef CPUX86}
+    {$ifndef DISABLE_X86_CPUINTEL}
+      {$define CPUINTEL}
+      {$ASMMODE INTEL}
+    {$else}
+      { Assembler code uses references to static
+        variables with are not PIC ready }
+      {$define PUREPASCAL}
+    {$endif}
+  {$else CPUX86}
+  {$define PUREPASCAL}
+  {$endif}
+{$endif CPU64}
+
 interface
 
 uses
@@ -72,7 +120,9 @@ function SimpleChecksumHash(AKey: Pointer; ALength: SizeInt): UInt32;
 // https://code.google.com/p/hedgewars/source/browse/hedgewars/adler32.pas
 function Adler32(AKey: Pointer; ALength: SizeInt): UInt32;
 function sdbm(AKey: Pointer; ALength: SizeInt): UInt32;
-function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
+function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;{$IFNDEF CPUINTEL}inline;{$ENDIF}
+// pure pascal implementation of xxHash32
+function xxHash32Pascal(crc: cardinal; P: Pointer; len: integer): cardinal;
 
 type
   THasher = function(crc: cardinal; buf: Pointer; len: cardinal): cardinal;
@@ -927,37 +977,6 @@ begin
   Result := Int32(c);
 end;
 
-{$ifdef FPC_PIC}
-  {$define DISABLE_X86_CPUINTEL}
-{$endif FPC_PIC}
-
-{$if defined(OPENBSD) or defined(EMX) or defined(OS2)}
-  { These targets have old GNU assemblers that }
-  { do not support all instructions used in assembler code below }
-  {$define DISABLE_X86_CPUINTEL}
-{$endif}
-
-{$ifdef CPU64}
-  {$define PUREPASCAL}
-  {$ifdef CPUX64}
-    {$define CPUINTEL}
-    {$ASMMODE INTEL}
-  {$endif CPUX64}
-{$else}
-  {$ifdef CPUX86}
-    {$ifndef DISABLE_X86_CPUINTEL}
-      {$define CPUINTEL}
-      {$ASMMODE INTEL}
-    {$else}
-      { Assembler code uses references to static
-        variables with are not PIC ready }
-      {$define PUREPASCAL}
-    {$endif}
-  {$else CPUX86}
-  {$define PUREPASCAL}
-  {$endif}
-{$endif CPU64}
-
 {$ifdef CPUARM} // circumvent FPC issue on ARM
 function ToByte(value: cardinal): cardinal; inline;
 begin
@@ -1166,8 +1185,13 @@ asm
         {$endif}
 end;
 {$endif CPUX64}
-
 {$else not CPUINTEL}
+function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
+begin
+  result := xxHash32Pascal(crc, P, len);
+end;
+{$endif CPUINTEL}
+
 const
   PRIME32_1 = 2654435761;
   PRIME32_2 = 2246822519;
@@ -1181,7 +1205,7 @@ begin
   result := RolDWord(value, 13);
 end;
 
-function xxHash32(crc: cardinal; P: Pointer; len: integer): cardinal;
+function xxHash32Pascal(crc: cardinal; P: Pointer; len: integer): cardinal;
 var c1, c2, c3, c4: cardinal;
     PLimit, PEnd: PAnsiChar;
 begin
@@ -1203,7 +1227,12 @@ begin
   end else
     result := crc + PRIME32_5;
   inc(result, len);
-  while P <= PEnd - 4 do begin
+  { Use "P + 4 <= PEnd" instead of "P <= PEnd - 4" to avoid crashes in case P = nil.
+    When P = nil,
+    then "PtrUInt(PEnd - 4)" is 4294967292,
+    so the condition "P <= PEnd - 4" would be satisfied,
+    and the code would try to access PCardinal(nil)^ causing a SEGFAULT. }
+  while P + 4 <= PEnd do begin
     inc(result, PCardinal(P)^ * PRIME32_3);
     result := RolDWord(result, 17) * PRIME32_4;
     inc(P, 4);
@@ -1219,7 +1248,6 @@ begin
   result := result * PRIME32_3;
   result := result xor (result shr 16);
 end;
-{$endif CPUINTEL}
 
 {$ifdef CPUINTEL}
 
@@ -1593,7 +1621,7 @@ begin
   begin
     InitializeCrc32ctab;
     crc32c := @crc32cfast;
-    mORMotHasher := @xxHash32;
+    mORMotHasher := @{$IFDEF CPUINTEL}xxHash32{$ELSE}xxHash32Pascal{$ENDIF};
   end;
 end.
 
diff --git a/packages/rtl-generics/src/generics.helpers.pas b/packages/rtl-generics/src/generics.helpers.pas
index a03cf88..443e4a8 100644
--- a/packages/rtl-generics/src/generics.helpers.pas
+++ b/packages/rtl-generics/src/generics.helpers.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -14,6 +14,23 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.Helpers;
diff --git a/packages/rtl-generics/src/generics.memoryexpanders.pas b/packages/rtl-generics/src/generics.memoryexpanders.pas
index 77acbf4..6dc4ab9 100644
--- a/packages/rtl-generics/src/generics.memoryexpanders.pas
+++ b/packages/rtl-generics/src/generics.memoryexpanders.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -14,6 +14,23 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.MemoryExpanders;
diff --git a/packages/rtl-generics/src/generics.strings.pas b/packages/rtl-generics/src/generics.strings.pas
index da80e01..8e30f87 100644
--- a/packages/rtl-generics/src/generics.strings.pas
+++ b/packages/rtl-generics/src/generics.strings.pas
@@ -1,11 +1,11 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -14,6 +14,23 @@
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every patch
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit Generics.Strings;
diff --git a/packages/rtl-generics/src/inc/generics.dictionaries.inc b/packages/rtl-generics/src/inc/generics.dictionaries.inc
index 8405648..bfa8f7e 100644
--- a/packages/rtl-generics/src/inc/generics.dictionaries.inc
+++ b/packages/rtl-generics/src/inc/generics.dictionaries.inc
@@ -1,13 +1,13 @@
 {%MainUnit generics.collections.pas}
 
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -24,6 +24,23 @@
     Thanks to mORMot (http://synopse.info) project for the best implementations
     of hashing functions like crc32c and xxHash32 :)
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 { TPair<TKey,TValue> }
diff --git a/packages/rtl-generics/src/inc/generics.dictionariesh.inc b/packages/rtl-generics/src/inc/generics.dictionariesh.inc
index e0a66db..d563d21 100644
--- a/packages/rtl-generics/src/inc/generics.dictionariesh.inc
+++ b/packages/rtl-generics/src/inc/generics.dictionariesh.inc
@@ -1,13 +1,13 @@
 {%MainUnit generics.collections.pas}
 
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2014 by Maciej Izak (hnb)
-    member of the Free Sparta development team (http://freesparta.com)
+    member of the NewPascal development team (http://newpascal.org)
 
-    Copyright(c) 2004-2014 DaThoX
+    Copyright(c) 2004-2018 DaThoX
 
-    It contains the Free Pascal generics library
+    It contains the generics collections library
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
@@ -24,6 +24,23 @@
     Thanks to mORMot (http://synopse.info) project for the best implementations
     of hashing functions like crc32c and xxHash32 :)
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 {$WARNINGS OFF}
diff --git a/packages/rtl-generics/tests/tests.generics.arrayhelper.pas b/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
index f17263c..f55a438 100644
--- a/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
+++ b/packages/rtl-generics/tests/tests.generics.arrayhelper.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -17,6 +19,23 @@
     Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
     many new types, tests and major refactoring of entire library
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit tests.generics.arrayhelper;
diff --git a/packages/rtl-generics/tests/tests.generics.bugs.pas b/packages/rtl-generics/tests/tests.generics.bugs.pas
index 3328b23..0eac5c5 100644
--- a/packages/rtl-generics/tests/tests.generics.bugs.pas
+++ b/packages/rtl-generics/tests/tests.generics.bugs.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -17,7 +19,25 @@
     Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
     many new types, tests and major refactoring of entire library
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
+
 unit tests.generics.bugs;
 
 {$mode delphi}
diff --git a/packages/rtl-generics/tests/tests.generics.hashmaps.pas b/packages/rtl-generics/tests/tests.generics.hashmaps.pas
index 1219d88..46af7dd 100644
--- a/packages/rtl-generics/tests/tests.generics.hashmaps.pas
+++ b/packages/rtl-generics/tests/tests.generics.hashmaps.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -17,6 +19,26 @@
     Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
     many new types, tests and major refactoring of entire library
 
+    Thanks to Castle Game Engine (https://castle-engine.sourceforge.io)
+    Part of tests for this module was copied from Castle Game Engine tests
+
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit tests.generics.hashmaps;
@@ -65,6 +87,8 @@ type
     procedure Test_ObjectDictionary;
 
     procedure Test_TryAddOrSetOrGetValue;
+    procedure Test_TryGetValueEmpty_xxHash32;
+    procedure Test_TryGetValueEmpty_xxHash32Pascal;
   end;
 
 implementation
@@ -360,6 +384,43 @@ begin
   end;
 end;
 
+// modified test from Castle Game Engine (https://castle-engine.io/)
+{$DEFINE TEST_TRYGETEMPTYVALUE :=
+  try
+    Map.AddOrSetValue('some key', 'some value');
+
+    B := Map.TryGetValue('some key', V);
+    AssertTrue(B);
+    AssertEquals('some value', V);
+
+    B := Map.TryGetValue('some other key', V);
+    AssertFalse(B);
+
+    B := Map.TryGetValue('', V);
+    AssertFalse(B);
+  finally
+    FreeAndNil(Map)
+  end;
+}
+
+procedure TTestHashMaps.Test_TryGetValueEmpty_xxHash32;
+var
+  Map: TOpenAddressingLP<string, string, TxxHash32HashFactory>;
+  V: String; B: Boolean;
+begin
+  Map := TOpenAddressingLP<string, string, TxxHash32HashFactory>.Create;
+  TEST_TRYGETEMPTYVALUE;
+end;
+
+procedure TTestHashMaps.Test_TryGetValueEmpty_xxHash32Pascal;
+var
+  Map: TOpenAddressingLP<string, string, TxxHash32PascalHashFactory>;
+  V: String; B: Boolean;
+begin
+  Map := TOpenAddressingLP<string, string, TxxHash32PascalHashFactory>.Create;
+  TEST_TRYGETEMPTYVALUE;
+end;
+
 begin
   RegisterTest(TTestHashMaps);
 end.
diff --git a/packages/rtl-generics/tests/tests.generics.sets.pas b/packages/rtl-generics/tests/tests.generics.sets.pas
index 63cfbfa..2a4c633 100644
--- a/packages/rtl-generics/tests/tests.generics.sets.pas
+++ b/packages/rtl-generics/tests/tests.generics.sets.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -17,7 +19,25 @@
     Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
     many new types, tests and major refactoring of entire library
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
+
 unit tests.generics.sets;
 
 {$mode delphi}
diff --git a/packages/rtl-generics/tests/tests.generics.stdcollections.pas b/packages/rtl-generics/tests/tests.generics.stdcollections.pas
index e12edc6..86a6de6 100644
--- a/packages/rtl-generics/tests/tests.generics.stdcollections.pas
+++ b/packages/rtl-generics/tests/tests.generics.stdcollections.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -20,6 +22,23 @@
     Thanks to Castle Game Engine (https://castle-engine.sourceforge.io)
     Part of tests for this module was copied from Castle Game Engine tests
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit tests.generics.stdcollections;
diff --git a/packages/rtl-generics/tests/tests.generics.trees.pas b/packages/rtl-generics/tests/tests.generics.trees.pas
index 415c36d..0adc726 100644
--- a/packages/rtl-generics/tests/tests.generics.trees.pas
+++ b/packages/rtl-generics/tests/tests.generics.trees.pas
@@ -1,7 +1,9 @@
 {
-    This file is part of the Free Pascal run time library.
+    This file is part of the Free Pascal/NewPascal run time library.
     Copyright (c) 2018 by Maciej Izak (hnb),
-    member of the Free Pascal development team
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
 
     It contains tests for the Free Pascal generics library
 
@@ -17,6 +19,23 @@
     Thanks to Sphere 10 Software (http://sphere10.com) for sponsoring
     many new types, tests and major refactoring of entire library
 
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
  **********************************************************************}
 
 unit tests.generics.trees;
diff --git a/packages/rtl-generics/tests/tests.generics.utils.pas b/packages/rtl-generics/tests/tests.generics.utils.pas
index 1572c85..50bb84d 100644
--- a/packages/rtl-generics/tests/tests.generics.utils.pas
+++ b/packages/rtl-generics/tests/tests.generics.utils.pas
@@ -1,3 +1,38 @@
+{
+    This file is part of the Free Pascal/NewPascal run time library.
+    Copyright (c) 2014 by Maciej Izak (hnb)
+    member of the NewPascal development team (http://newpascal.org)
+
+    Copyright(c) 2004-2018 DaThoX
+
+    It contains tests for the Free Pascal generics library
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************
+
+ !!! IMPORTANT NOTE about usage of Generics.Collections and bug reports !!!
+
+ author of this library has no access to FPC trunk anymore, so every problem
+ related to this library should be reported here :
+
+ https://github.com/maciej-izak/generics.collections/issues
+
+ The library is compatible with NewPascal, FPC 3.0.4 and FPC trunk, every problem
+ (if possible) will be re-reported to FPC bugtracker with proper patch by main author.
+ Compatibility with FPC 3.0.4 and trunk will be provided as long as possible.
+
+ The NewPascal has special support for this library, more recent version (more 
+ bug fixes), more optimizations and better support from compiler side 
+ (NewPascal contains modified/extended FPC compiler version).
+
+ **********************************************************************}
+
 unit tests.generics.utils;
 
 {$mode delphi}
-- 
2.9.3.windows.2

rtl-generics.june.patch (45,972 bytes)

Thaddy de Koning

2018-06-28 19:41

reporter   ~0109118

The patches are welcome, but I would suggest that the header parts need some work.
Sorry Maciej but such opiniated headers don't belong in trunk. It is also not relevant. (Yes, that's me, Thaddy)

Maciej Izak

2018-06-28 19:56

reporter   ~0109119

It can be for sure improved but please point which part is in your opinion "opiniated". My intention was to include pure facts and proper working links. The development is now really complicated for me and I need clearly point to the roots of the library where bugs can be reported.

Thaddy de Koning

2018-06-28 21:24

reporter   ~0109120

Last edited: 2018-06-28 21:35

View 3 revisions

That's fair enough. Since I am a political scientist by study (one of them) I will try and come up with an acceptable solution.....
Mind you: links are a complete NoNo. Links tend to disappear and do not belong in headers. Now I am going to think about the rest.
But links can be added to a readme.

Michael Van Canneyt

2018-06-28 22:18

administrator   ~0109121

As a matter of fact, we're discussing on core what to do with this.

There are several issues under discussion:

1. Change of the copyright notice.

   There is debate on how to handle this.
   Keeping it, stripping that part of the patch or moving it or some other option.

2. The headers are definitely opinionated.

   Things like 'no more acces to SVN' are irrelevant.
   Publicity like 'Newpascal has better support' also doesn't belong there.

   Simply stating that the primary repository is your repository is obviously OK, that bugs are best reported on Github also, but you must take into account that the primary bug reporting area for all things related FPC will remain the FPC bugtracker for us, and for most of the users.

3. The bugtracker and primary repository info will most likely be moved to a readme file, since - as Thaddy correctly observes - such things have no place in source files.

Michael Van Canneyt

2018-06-29 22:49

administrator   ~0109130

Applied a modified version of the patch, after discussion on core.

* Copyright information is kept intact.
* Removed opinionated comments.
* Moved list of open bug IDs to readme.txt file, reduced it to actually open bugs.
* Noted in readme.txt file that the github repo is now the main repo for this source code. Primary bugtracker for the copy in FPC is still the FPC bugtracker.
* Renamed TMormotHashFactory to TGenericsHashFactory
* TDefaultHashFactory is again TDelphiQuadrupleHashFactory, because
./examples/thashmapextendedequalitycomparer/thashmapextendedequalitycomparer.lpr
no longer compiled: TGenericsHashFactory does not implement the GetHashList call.

Thanks for the update.

Issue History

Date Modified Username Field Change
2018-06-28 08:40 Maciej Izak New Issue
2018-06-28 08:40 Maciej Izak File Added: rtl-generics.june.patch
2018-06-28 09:00 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-06-28 09:00 Michael Van Canneyt Status new => assigned
2018-06-28 19:41 Thaddy de Koning Note Added: 0109118
2018-06-28 19:56 Maciej Izak Note Added: 0109119
2018-06-28 21:24 Thaddy de Koning Note Added: 0109120
2018-06-28 21:34 Thaddy de Koning Note Edited: 0109120 View Revisions
2018-06-28 21:35 Thaddy de Koning Note Edited: 0109120 View Revisions
2018-06-28 22:18 Michael Van Canneyt Note Added: 0109121
2018-06-29 22:49 Michael Van Canneyt Fixed in Revision => 39345
2018-06-29 22:49 Michael Van Canneyt Note Added: 0109130
2018-06-29 22:49 Michael Van Canneyt Status assigned => resolved
2018-06-29 22:49 Michael Van Canneyt Fixed in Version => 3.1.1
2018-06-29 22:49 Michael Van Canneyt Resolution open => fixed
2018-06-29 22:49 Michael Van Canneyt Target Version => 3.2.0