[fpc-devel] TFPHashList (Was: Alternative parsers)
Sergei Gorelkin
sergei_gorelkin at mail.ru
Thu Oct 21 19:33:17 CEST 2010
Hans-Peter Diettrich пишет:
> Marco van de Voort schrieb:
>
>>> PChars, on the other hand, require manual memory management
>>> which is the source of bugs.
>>
>> Point out the example of bugs. (ones that matter, not the stylistic ones)
>
> The usage of PString essentially is using an crippled AnsiString,
> without reference counting. I did not yet find any (obvious) bugs, but
> several flaws where ShortStrings are allocated, copied and disposed for
> no reason. See pmodules.try_consume_hintdirective.
>
In pmodules.try_consume_hintdirective, copying happens exactly once; if you write
something like "type foo=class end deprecated 'a' deprecated 'b';" it will end up
with IE200910181. That deserves a fix with a more user-friendly error message, but the logic is correct.
Regards,
Sergei
More information about the fpc-devel
mailing list