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

Alexander Klenin klenin at gmail.com
Thu Nov 19 09:50:31 CET 2009

On Thu, Nov 19, 2009 at 18:36, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:

> More importantly, another thing it would affect is that in case someone has
> written their own fillchar with an out parameter, and *expects* reference
> counted structures to be finalised at the caller side before they are
> overwritten with zeroes by their routine. Changing that behaviour woud
> a) result in memory leaks when using such a routine
> b) not be fixable without manually adding finalize calls everywhere this
> custom fillchar routine is called, since the required typeinfo is not
> available at the callee side

This does indeed sound like an horrible hack for me, but I do not
understand the problem fully.
Can you give an example code which would be (badly) affected by proposed change?

Alexander S. Klenin

More information about the fpc-devel mailing list