[Bf-committers] Re: Bf-committers Digest, Vol 16, Issue 47

Yomgui yomgui1 at gmail.com
Fri Nov 25 11:24:22 CET 2005


> Date: Fri, 25 Nov 2005 10:17:54 +0100 (CET)
> From: Alexander Ewering <blender at instinctive.de>
> Subject: Re: [Bf-committers] Some words about a strange thing named
> To: bf-blender developers <bf-committers at projects.blender.org>
> Message-ID: <Pine.LNX.4.61.0511251017270.2184 at time.intrr.org>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
>
> On Fri, 25 Nov 2005, Yomgui wrote:
>
> > It's not the first time that I seen some developpers saying "I never
> > check functions return... It tooks me too many time...". I totally
> > disagree that.
>
> Ton's point just is that if your system is so f*cked that it returns
> NULL for malloc, you probably have worse things to worry about than
> a crashing application. And I totally agree ;-)
>

I know and I understand the point of Ton, I'm just not agree with it,
and I explain for what.
I think that you've not written the wanted sentence, you thinked
'crashes' than 'returns', was it?

For all:
And I don't want enter in a discution about "what is a f*cked system?".
Don't launch a troll, please.


> ------------------------------
>
> Message: 8
> Date: Fri, 25 Nov 2005 20:47:16 +1100
> From: Jonathan Merritt <j.merritt at pgrad.unimelb.edu.au>
> Subject: Re: [Bf-committers] Some words about a strange thing named
> To: bf-blender developers <bf-committers at projects.blender.org>
> Message-ID: <4386DDA4.1070708 at pgrad.unimelb.edu.au>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> This is a valid point, but the more important question is:
>
>     "So, we check for NULL, and then do... ?   What, exactly?"
>
> IMHO, a NULL return should typically be handled at a high level by the
> malloc() wrapper.  I mean, what can Blender *do* if it can't access any
> more memory?  Some suggestions:
>     1. Empty caches, and then try again.
>     2. Give up, try to save and quit (storing a "run out of memory" flag
> in the memory manager to prevent recursion).
>     3. (...)?

3. just put an "if (malloc == NULL) { handle null pointer }"
There are not so malloc() in the code... ;-)
You've already done much complexe things in past, no ? ;-)

GR


More information about the Bf-committers mailing list