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

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


On 19 Nov 2009, at 11:39, Thaddy wrote:

> Jonas Maebe wrote:
>>
>> If you change the behaviour of "out" so that such parameters are no  
>> longer finalised before the routine is entered, then the above will  
>> cause a memory leak. You can verify this by changing the "out rec"  
>> parameter into "var rec".
>>
> Then this is definitely not a sextopod but an octopod. (really  
> serious bug) The "out" should behave like "var" + referencecount and  
> finalization outside the procedure or function.

That is exactly how it behaves right now, so I don't understand your  
remark. My example is about what would happen if the behaviour of  
"out" would be changed into the same as "var" (except that the  
compiler would not give *hints* about potentially uninitialised data).


Jonas



More information about the fpc-devel mailing list