[fpc-pascal] reference-counted function results not initialized to nil
Dimitrios Chr. Ioannidis
d.ioannidis at nephelae.eu
Sun Jun 26 20:07:15 CEST 2016
Hi,
On 26/6/2016 7:20 μμ, Jürgen Hestermann wrote:
> And because it is a manged type I could rely on the documentation
> which says that managed types are initialized (with zero length/nil).
> "Result" is used in the same way as a (local) variable.
> What should make me think that it is different?
as Barry Kelly pointed out there
http://stackoverflow.com/questions/861045/which-variables-are-initialized-when-in-delphi/861178#861178,
initialization differs on what mechanism was used to allocate memory .
AFAIU, "initialized" <> "zero-filled" .
regards,
--
Dimitrios Chr. Ioannidis
www.nephelae.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160626/a41de64d/attachment.html>
More information about the fpc-pascal
mailing list