[fpc-devel] Redefine FillChar() to use out parameter instead

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Nov 19 11:31:54 CET 2009

On 19 Nov 2009, at 11:21, Alexander Klenin wrote:

> On Thu, Nov 19, 2009 at 19:20, Martin <lazarus at mfriebe.de> wrote:
>> Jonas Maebe wrote:
> [skipped example]
>> Well in this case, the code is actually positively affected by the  
>> "out"
>> param (because it avoids the mem leak)
> Jonas, can you confirm that your example is incorrect one,
> and Martin's example below is actually what you meant?

Why do you think my example is incorrect? It currently runs without a  
memory leak, and would result in a memory leak if the semantics of  
"out" would be changed from "parameters are automatically finalized at  
the caller side" into "no finalization is performed".

You did ask for an example where changing the semantics of "out" would  
change the behaviour of existing code, didn't you?


More information about the fpc-devel mailing list