lsan_internals.h - mhahnFr/LeakSanitizer Wiki

Using the variables defined in this header, the behaviour of the sanitizer can be adjusted.

extern bool __lsan_humanPrint

If this value is set to true, the byte amounts are printed in a human friendly way.
Defaults to true.

extern bool __lsan_printCout

If this value is set to true, normal messages are printed to the standard output stream. Otherwise the standard error stream is also used for normal messages.
Defaults to false.

Added in version 1.1.

extern bool __lsan_printFormatted

If this value is set to true, ANSII escape codes are used to format the output of this sanitizer. Otherwise, the output is not formatted using escape codes.
Defaults to true.

Added in version 1.1.

extern bool __lsan_printLicense

If this value is set to true, the license informations are printed upon normal termination of the program.
Defaults to true.

Added in version 1.1.

extern bool __lsan_printWebsite

If this value is set to true, the link to the home page of the LeakSanitizer is printed.

Added in version 1.4.

extern bool __lsan_invalidCrash

If this value is set to true, the program is terminated when doing something invalid regarding the memory management.
Defaults to true.

extern bool __lsan_invalidFree

If this value is set to true, the freed pointers are checked for whether they have previously been allocated using the sanitizer. If a pointer which is unknown to the sanitizer is freed, a warning or a termination is issued, according to the value __lsan_invalidCrash. Freeing a null pointer is not checked by this flag, but by __lsan_freeNull.
Defaults to false.

extern bool __lsan_freeNull

If this value is set to true, a warning is issued when a null pointer is freed. It does not cause a termination of the program, regardless of __lsan_invalidCrash.

extern bool __lsan_trackMemory

If this value is set to true, the memory fragmentation can be analyzed. It should be set at the very beginning of the program in order to get realistic results.
Defaults to false.

Added in version 1.2.

extern size_t __lsan_leakCount

This value defines the count of leaks that are printed at the exit of the program. If more leaks are detected, the first leaks are printed and a message about the truncation is also printed.
Defaults to 100.

Added in version 1.3.

extern int __lsan_callstackSize

This value defines the number of functions that are printed in a callstack. If there are more functions in such a callstack a message about the truncation is printed.
Defaults to 20.

Added in version 1.3.