> 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. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev