next up previous contents index
Next: 15.6 API reference Up: 15 List-based Memory Manager: Previous: 15.4 Restrictions and guarantees

15.5 Sanity checking

When the OSKit is compiled with debugging enabled (-enable-debug), a fairly large number of sanity checks are compiled into the LMM library to help detect memory list corruption bugs and such. Assertion failures in the LMM library can indicate bugs either in the LMM itself or in the application using it (e.g., freeing blocks twice, overwriting allocated buffers, etc.). In practice such assertion failures usually tend to be caused by the application, since the LMM library itself is quite well-tested and stable. For additional help in debugging memory management errors in applications that use the C-standard malloc/free interfaces, the OSKit's memdebug library can be used as well (see Section 19).

Note that the sanity checks in the LMM library are likely to slow down the library considerably under normal use, so it may be a good idea to turn off this debugging support when linking the LMM into ``stable'' versions of a program.



University of Utah Flux Research Group