O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Debugging Memory Problems

Errors in memory management cause a huge number of problems when programming in C and can lead to difficult-to-track-down bugs since the manifestation of a problem can happen long after the actual program error happened.

Common API issues

When malloc() cannot allocate memory, it returns NULL. Many programmers tend to ignore NULL results from malloc(). The conventional wisdom was that if memory really is exhausted, then the system is in some pretty serious trouble and is swapping heavily. In that case, it is just easier to crash and restart. Plus, it can be tedious to check the return value of malloc() all the time. In these days of systems with many gigabytes of RAM, it’s possible for an app to fill up its address space ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required