Re: xmalloc string functions
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 20:06:44 +0000
Malcolm McLean wrote, On 29/01/08 10:06:
"Flash Gordon" <spam@xxxxxxxxxxxxxxxxxx> wrote in messageNot 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.
It did not cause me significant extra work. The most likely reason for the difference is that I designed the entire system knowing that out-of-resource errors *do* occur so it was part of the entire design concept rather than an extra I had to try and fit in.
Oh, and my real-time applications degraded gracefully rather than failing on out-of-time errors as well. Again it was a case of considering how to do the job properly during the design of the application not during coding.
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().
Well, I would not have used your BabyX library anyway, but now I have even more reason to avoid it.
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.
Your knowledge is still faulty.
--
Flash Gordon
.
- Follow-Ups:
- Re: xmalloc string functions
- From: ymuntyan
- 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
- Re: xmalloc string functions
- From: Malcolm McLean
- xmalloc string functions
- Prev by Date: Prepend name to function names?
- Next by Date: Re: Prepend name to function names?
- Previous by thread: Re: xmalloc string functions
- Next by thread: Re: xmalloc string functions
- Index(es):
Relevant Pages
|