<div dir="ltr">

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I'm<span> </span></span><span class="gmail-il" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">pleased</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>to finally<span> </span></span><span class="gmail-il" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">announce</span> next release of rtl-generics aka Generics.Collections 2.0<div><br></div><div>version for trunk available in trunk ;)</div><div>version for 3.0.4 available at : <a href="https://github.com/maciej-izak/generics.collections">https://github.com/maciej-izak/generics.collections</a><br><div><br></div><div><div>What is new:</div><div>* New collections:</div><div>    - TSortedList<T></div><div>    - THashSet<T></div><div>    - TAVLTreeMap<TKey, TValue></div><div>    - TIndexedAVLTreeMap<TKey, TValue></div><div>    - TAVLTree<T></div><div>    - TIndexedAVLTree<T></div><div>    - TSortedSet<T></div><div>    - TSortedHashSet<T> (this one collection is especially interesting - optimized mix of dictionary and AVL tree)</div><div>* New hash functions (the optimal hash function for collections is selected depending on environment)</div><div>* Bug fixes</div><div>* Tests</div><div>* My favorite and related to my compiler stuff like management operators (also related to all managed types) : new Ptr property for all collections. How it works and what is the gain? Simple example:</div><div><br></div><div>====== code begin ======</div><div><div>type</div><div>  TIntfObject = class(TInterfacedObject, IUnknown)</div><div>  protected</div><div>    function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};</div><div>    function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};</div><div>  end;</div><div><br></div><div>function TIntfObject._AddRef: longint; stdcall;</div><div>begin</div><div>  Writeln('_AddRef');</div><div>  Result := inherited;</div><div>end;</div><div><br></div><div>function TIntfObject._Release: longint; stdcall;</div><div>begin</div><div>  Result := inherited;</div><div>  Writeln('_Release');</div><div>end;</div><div><br></div><div>procedure Test;</div><div>var</div><div>  List: TList<IInterface>;</div><div>  item: IInterface;</div><div>  itemPtr: ^IInterface;</div><div>begin</div><div>  WriteLn('--- initialization ---');</div><div>  List := TList<IInterface>.Create;</div><div>  List.Add(TIntfObject.Create);</div><div>  List.Add(TIntfObject.Create);</div><div>  List.Add(TIntfObject.Create);</div><div>  WriteLn('--- ptr loop ---');</div><div>  for itemPtr in List.Ptr^ do</div><div>    { something };</div><div>  WriteLn('--- loop ---');</div><div>  for item in List do</div><div>    { something };</div><div>  WriteLn('--- finalization ---');</div><div>  List.Free;</div><div>end;</div><div><br></div><div>begin</div><div>  Test;</div><div>  WriteLn('--- end ---'); </div></div><div>end.</div><div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">====== code end ======</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div></div><div>Output:</div><div><br></div><div><div><div>--- initialization ---</div><div>_AddRef</div><div>_AddRef</div><div>_AddRef</div><div>--- ptr loop ---</div><div>--- loop ---</div><div>_AddRef</div><div>_AddRef</div><div>_Release</div><div>_AddRef</div><div>_Release</div><div>--- finalization ---</div><div>_Release</div><div>_Release</div><div>_Release</div><div>_Release</div><div>--- end ---</div></div></div><div><br></div><div>by usage pointer as enumerator was possible to omit all _AddRef & _Release calls. The optimization is highly visible for extensive usage of managed types.</div><div><br></div><div><div>Acknowledgment / credits:</div><div><br></div><div>Thanks to Sphere 10 Software (<a href="http://sphere10.com">http://sphere10.com</a>) for sponsoring many new types and major refactoring of entire library</div><div><br></div><div>Thanks to mORMot (<a href="http://synopse.info">http://synopse.info</a>) project for the best implementations of hashing functions like crc32c and xxHash32 :)</div></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div></div>