Re: xmalloc string functions
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 10:06:14 -0000
"Flash Gordon" <spam@xxxxxxxxxxxxxxxxxx> wrote in message
Not always. I've done it using structured programming in assembler without implementing exceptions and at each point I checked the status and propagated the error until it could be handled. The handling consisted of processing what it had memory for giving degraded performance instead of giving up which would not have been acceptable. It was also easy to do because I new resources were limited and designed the SW assuming that they could run out.I've done this as well. It was adding so much complexity to code, all because of allocation failures that couldn't happen. Finally, within BabyX (my X windows toolkit) there was no way I could think of of propagating the error conditions back to the caller. Flow control is just too complex with the whole thign beign held together by a newtwork of function pointers. So I decided BabyX would use xmalloc().
Then I realised that this released something for string handling. because we know that those string functions can never return null, code using them is so much more expressive and flexible.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- Follow-Ups:
- Re: xmalloc string functions
- From: Flash Gordon
- Re: xmalloc string functions
- References:
- xmalloc string functions
- From: Malcolm McLean
- Re: xmalloc string functions
- From: Yevgen Muntyan
- Re: xmalloc string functions
- From: William Ahern
- Re: xmalloc string functions
- From: Yevgen Muntyan
- Re: xmalloc string functions
- From: William Ahern
- Re: xmalloc string functions
- From: Yevgen Muntyan
- Re: xmalloc string functions
- From: William Ahern
- Re: xmalloc string functions
- From: Yevgen Muntyan
- Re: xmalloc string functions
- From: William Ahern
- Re: xmalloc string functions
- From: Yevgen Muntyan
- Re: xmalloc string functions
- From: Flash Gordon
- Re: xmalloc string functions
- From: ymuntyan
- Re: xmalloc string functions
- From: Flash Gordon
- xmalloc string functions
- Prev by Date: Re: Thoughts on file organisation
- Next by Date: Re: Thoughts on file organisation
- Previous by thread: Re: xmalloc string functions
- Next by thread: Re: xmalloc string functions
- Index(es):