[fpc-pascal] rtl-generics: Suggestion and question

Maciej Izak hnb.code at gmail.com
Fri Aug 12 20:51:12 CEST 2016


2016-08-12 19:17 GMT+02:00 silvioprog <silvioprog at gmail.com>:

> Those hints can be a problem when we also need to check the log from other
> classes, because it pollute the windows messages, so a suggestion is just
> to declare the "{$WARN 5024 OFF : Parameter "$1" not used}" in the
> rtl-generics units.
>
The question is regarding to TDictionary, because I'm not sure if it is a
> concrete class on its actual implementation stage (I'm using FPC from
> trunk). See the warnings below:
>
> === begin warns ===
>
> generics.dictionaries.inc(158,92) Warning: Constructing a class
> "TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
> "DoMoveNext"
> generics.dictionaries.inc(158,92) Warning: Constructing a class
> "TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
> "GetCurrent"
> generics.dictionaries.inc(158,92) Warning: Constructing a class
> "TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
> "DoMoveNext"
> generics.dictionaries.inc(158,92) Warning: Constructing a class
> "TCustomDictionaryEnumerator$4$crc7DF95A99" with abstract method
> "GetCurrent"
>
> === end warns ===
>

Using WARN OFF for whole module is rather bad, but might be (temporary) the
only solution. IIRC FPC has many bugs for switching off warnings / hints
especially for generics. Compiler likes to report warnings/hints in
specialization place/module (which each of reported warnings was disabled
in structure declaration).


> I want to use the TDictionary in a beta project, but I'm not sure if today
> it is only for experimental purposes. :-/
>
TDictionary is very stable and well tested. Feel free to use that structure
it definitely should stay without many modifications (generally public
interface is stable - compatibility with Delphi).

the only candidate to remove is :

procedure GetMemoryLayout(const AOnGetMemoryLayoutKeyPosition:
TOnGetMemoryLayoutKeyPosition);

which was used only for testing purposes, thanks to GetMemoryLayout you can
see how looks memory layout for each kind of dictionary (we have many
memory layouts, even more - we have unique de-amortized cuckoo hashing -
http://arxiv.org/abs/0903.0391 declared as THashMap/TFastHashMap).

-- 
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160812/55c43d24/attachment.html>


More information about the fpc-pascal mailing list