Porting to RISC OS

Stefan Bellon sbellon at sbellon.de
Thu Sep 4 19:39:46 CEST 2003


Matthias Andree wrote:
> Stefan Bellon <sbellon at sbellon.de> writes:

> > I've ported bogofilter to the rarely known operating system RISC OS.

> A former fellow student of mine showed me his Risc PC (don't recall
> the exact type or CPU and memory) in I believe 1997, with these
> stackable case and Risc OS 3.X IIRC,

I have two of them here. ;-) But you should see our nice new RISC OS
computer which is out since December 2002 and called Iyonix PC. Guess
what, I'm writing this email with one. And RISC OS is now at version 5.

> but I chose to buy a 68060 board for my Amiga 4000 instead. ;-)

Wrong decision. ;-)

> > Depending on which RISC OS compiler I use, I run into trouble with
> > the xmalloc/xcalloc functions.
> >
> > At present, it may be possible that malloc(0) is called and
> > afterwards it's checked what happened.

> Correct. malloc returns NULL on failure (usually ENOMEM, out of
> memory). Some implementations however also return NULL for malloc(0),
> which is allowed by IEEE Std 1003.1-2001,

Yes, I know, I read the Single Unix Specification after the problems I
ran into.

[snip]

> > In fact, I had to rewrite it this way in order to work-around what
> > seems to be a bug in our UnixLib

> Can you give details? I fail to see how even the most severe malloc()
> bug would require a rewrite/change of xmalloc.

If malloc(0) causes problems (yes, that would be a bug in malloc), then
my version doesn't even call malloc(0) in the first place and therefore
does not run into the trouble whereas the current CVS version first
calls malloc(0) and then tries to cope with that. Granted, if malloc is
implemented correctly and has no bug, then it should work with the
current CVS version.

-- 
Stefan Bellon




More information about the bogofilter-dev mailing list