[fpc-devel] RFC: customvariant handling in variants.pp and fmtbcd.pp
LacaK
lacak at zoznam.sk
Thu Mar 24 07:27:30 CET 2011
Hi Sergei,
>>> Doing what you propose isn't good. Checking for custom variant type
>>> is expensive because it involves locking, therefore custom variant
>>> handling should be done *after* the standard types.
> Both committed in r17170, with some changes:
>
great thanks!
> In fmtbcd.pp, I used VarDataFromStr method instead of assigning
> individual fields of TVarData;
> if I understand things correctly, this method exist precisely for such
> cases.
ok thanks,
I have attached minor "rearangement", consider them please
>
> In variants.pp, I used an individual function, with an out-parameter
> of type AnsiString. Such approach allows to avoid finalization of the
> intermediate Variant.
>
ok, thank you very much
I have looked again at function FindCustomVariantType and I see there :
3590 Result:=(aVarType>=CMinVarType);
3591 if Result then
So it seems to me, that for standard variant types is control immediately returned, so no performance problem should exist there with entering critical section and so on.
Or I missed something ?
Laco.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fmtbcd_castto.txt
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20110324/259fb234/attachment.txt>
More information about the fpc-devel
mailing list