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

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Nov 19 12:02:30 CET 2009


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

> On Thu, Nov 19, 2009 at 20:46, Jonas Maebe  
> <jonas.maebe at elis.ugent.be> wrote:
>>
>> I don't know by heart anymore, but as I mentioned the compiler  
>> crashed when
>> I tried that (or if you did that move, which has the same problem).  
>> There is
>> probably rtl or generated initialisation code that depends on the  
>> current
>> semantics of move/fillchar).
>
> So, we are unable to fix FillChar because it would uncover bugs hiding
> in the other places? ;-)

See Martin's reply.

> Ok, so how about introducing, say, FillMem procedure, which is
> identical to FillChar
> except that it has "out" parameter,

See http://lists.freepascal.org/lists/fpc-devel/2009-November/018559.html

FillMem would be a very bad name though, because it in now way  
suggests how it would differ from FillChar (a bit like the confusing  
AllocMem vs GetMem). FillCharFinalized, or FinalizeAndFill or so would  
be more appropriate.

> and deprecation of FillChar?

I don't see any reason to deprecate FillChar.


Jonas



More information about the fpc-devel mailing list