Development/malloc check: Difference between revisions

From KDE TechBase
(Page to explain what is MALLOC_CHECK_ his usage in KDE, and how affect to our applications.)
 
No edit summary
Line 15: Line 15:
More information in malloc(3).
More information in malloc(3).


Example of crash because of this variable.
[[Development/malloc_check_crashExample | Example of crash because of this variable.]]

Revision as of 22:11, 15 July 2009


MALLOC_CHECK_

The MALLOC_CHECK_ environment variable is used in malloc(3), to decide which implementation use. It could have 4 different values:

  • MALLOC_CHECK_ is not set: When MALLOC_CHECK_ has not been set, then malloc(3) have the usual behavior, nothing special happens.
  • MALLOC_CHECK_ = 0: All errors are silently ignored.
  • MALLOC_CHECK_ = 1: On error, a diagnostic message is printed on stderr.
  • MALLOC_CHECK_ = 2: On error, abort(3) is called without a diagnostic message.
  • MALLOC_CHECK_ = 3: abort(3) is called, and a diagnostic message is printed.


startkde script set this variable to 2 in trunk, so maybe you'll have crashes because of that.

Notice that, the faster implementation is which is used when MALLOC_CHECK_ is not defined.

More information in malloc(3).

Example of crash because of this variable.