[Mesa-dev] [PATCH 0/2] Simple Klocwork patches

Iago Toral itoral at igalia.com
Wed Feb 3 15:12:34 UTC 2016


Hi Juha,

I don't know why checking for this might be more relevant in Windows,
but in any case:

There are a ton of other places in mesa where we allocate memory via
calloc/malloc and we don't check that the allocation actually succeeded
so I am not sure that fixing a couple of instances of *small*
allocations changes anything.

IMHO, this kind of things are only really useful when allocating memory
for large amounts of data, otherwise even if you check for a NULL
allocation you still need to make sure that you don't need any extra
memory to handle that situation, and _mesa_error() needs memory, so it
is probably not really giving us anything in practice other than
silencing Klocwork...

Iago

On Wed, 2016-02-03 at 10:56 +0200, Juha-Pekka Heikkila wrote:
> I'm thinking these things maybe could be wrapped up inside something like
> "#ifdef windows" or so in the future. At least for Android and Linux these
> are normally quite useless.
> 
> /Juha-Pekka
> 
> Juha-Pekka Heikkila (2):
>   i965: in brw_link_shader() react to low memory
>   glsl: Check for null pointer at ir_variable_refcount_visitor()
> 
>  src/compiler/glsl/ir_variable_refcount.cpp | 7 +++++++
>  src/mesa/drivers/dri/i965/brw_link.cpp     | 4 ++++
>  src/mesa/main/ff_fragment_shader.cpp       | 6 ++++--
>  3 files changed, 15 insertions(+), 2 deletions(-)
> 




More information about the mesa-dev mailing list