Reason of REALLOC implementation ?

Tom Hughes tom at compton.nu
Mon Apr 16 00:03:24 BST 2007


In message <E1HdD3W-000JWi-NT at pr-webmail-2.demon.net>
          jonathan at doves.demon.co.uk wrote:

>    John.Tytgat at aaug.net wrote:
> 
> > In !OsLib/Tools/support there are two files realloc.c and realloc.h which
> > implement the REALLOC() function.  The file !OsLib/Tools/support/doc/realloc
> > says:
> > 
> > --8<--
> > realloc.c
> > ---------
> > 
> >    Just a portable realloc with no bugs. It's called REALLOC, though.
> > --8<--
> > 
> > Does someone know which bugs (and in which component) this document
> > refers too ? Bugs in a cross compiled environment ? Or bugs in RISC OS SCL ?
> 
>    Well, vaguely ...
> 
>    It was SharedCLib, but I don't remember the precise problem. It may have
> been something to do with the fact that it used to return a non-NULL value
> for malloc(0).

Which is of course entirely valid according to the ISO C standard...

Assuming, of course, that the value it returned was a valid heap
object that could be passed to free() in due course.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/



More information about the oslib-team mailing list