摘要 |
<p>A library of specialized routines (3) is described herein, some routines of which implement the malloc interface (110, 120, 130, 140). The malloc interface routines also label each allocated bloc with several items of information, including a partial call chain beginning with the caller of malloc. Other routines use the information present in the label to track pointers and memory leaks, so as to help a programmer debug a program. In its most basic form, the method of tracking memory leaks includes the steps of: associating allocated blocks with partial call chains (510); marking allocated blocks with partial call chains (520); marking accessible allocated blocks (560); searching memory for unmarked allocated blocks (570); and, reporting partial call chains of unmarked allocated blocks (580).</p> |