[Bf-committers] Some words about a strange thing named "coding-rules"

Ton Roosendaal ton at blender.org
Thu Nov 24 16:26:32 CET 2005


All our current platforms crash Blender nicely on referencing a NULL  
pointer. I've not heard of OS's crashing for it. How Morphos does this  
I don't know...

I do realize that every routine in Blender should not fail on mallocs,  
but this is very painful coding for more complex areas (like render  
system). Typically, a system already has been swapped totally unusable  
before it starts returning NULLs, and a user already killed Blender. :)


On 24 Nov, 2005, at 9:44, Yomgui wrote:

> Hi to all Blender developers,
> During my port of Blender on MorphOS and a try to bring to blender a
> nice OS abstraction layer, I've seen some ugly code lines. So, I want
> to advise all developers about that:
> MEM_mallocN/MEM_callocN and all derivated, declared in
> intern/guardedalloc/mallocn.c, may return a null pointer (0) in some
> cases (i.e. not enough memory), but...
> ... I seen too many files that use these functions without any
> checking of the return value!
> The result of the usage of a null pointer is totally platform
> dependent, and may cause the whole crash of the platform in the worst
> case (I think that there is no best case ;-))
> So please, can you check your code and design it to handle this case?
> It's very important to have a good and clean software.
> Many thanks for your attention,
> Guillaume R.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
Ton Roosendaal  Blender Foundation ton at blender.org  

More information about the Bf-committers mailing list