[Mesa-dev] [PATCH 2/2] mesa: add hard limits for the number of varyings and uniforms for the linker

Dave Airlie airlied at gmail.com
Thu Nov 24 05:25:44 PST 2011


> By this same logic, malloc should never return NULL because most apps can't
> handle it.  Instead it should mmap /dev/null and return a pointer to that.
>  That analogy isn't as far off as it may seem:  in both cases the underlying
> infrastructure has lied to the application that an operation succeeded, and
> it has given it a resource that it can't possibly use.

malloc actually hardly ever returns NULL, so probably want to pick a
more sane example.

On UNIX malloc generally hasn't returned NULL since overcommit was
invented, what happens now is some time in the future
you attempt to use a page and your app dies.

So not only has someone suggested this, but its been implemented to do
what you least want, which is crash the app.

Dave.


More information about the mesa-dev mailing list