“Colin Burgess” <cburgess@qnx.com> wrote in message
news:a5141d$db2$2@nntp.qnx.com…
Note that the source code is available from cvs.qnx.com! :v)
You’ll find another terrific resource in the programmers guide, chapter:
Heap Analysis - Making Memory Errors a Thing of the Past
Here’s a snip from the top of the online doc…
Introduction
Dynamic Memory Management
Heap Corruption
Detecting and Reporting Errors
Manual Checking (Bounds Checking)
Memory Leaks
Compiler Support
Summary
Introduction
If you develop a program that dynamically allocates memory, you’re also
responsible for tracking any memory that you allocate whenever a task is
performed, and for releasing that memory when it’s no longer required. If
you fail to track the memory correctly you may introduce “memory leaks,” or
unintentionally write to an area outside of the memory space.
Conventional debugging techniques usually prove to be ineffective for
locating the source of corruption or leak because memory-related errors
typically manifest themselves in an unrelated part of the program. Tracking
down an error in a multithreaded environment becomes even more complicated
because the threads all share the same memory address space.
In this chapter, we’ll introduce you to a special version of our memory
management functions that’ll help you to diagnose your memory management
problems.