diff options
author | Pavel Březina <pbrezina@redhat.com> | 2012-04-16 14:43:37 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-04-18 10:27:16 +0200 |
commit | 73b0ed650a75759b546022a9f0a4c609a856353c (patch) | |
tree | ae71a4fdef6f6fd29625e503d9734a32ae8cc16b /lib | |
parent | 30ca3915e50a9d9f71a28b7779fce81f8b6453d5 (diff) | |
download | samba-73b0ed650a75759b546022a9f0a4c609a856353c.tar.gz samba-73b0ed650a75759b546022a9f0a4c609a856353c.tar.bz2 samba-73b0ed650a75759b546022a9f0a4c609a856353c.zip |
Talloc doc: talloc_set_abort_fn()
Documents this function.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/talloc/talloc.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index c1b5650266..f87d4cc5cc 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -1772,12 +1772,43 @@ void talloc_enable_leak_report(void); */ void talloc_enable_leak_report_full(void); -/* @} ******************************************************************/ - +/** + * @brief Set a custom "abort" function that is called on serious error. + * + * The default "abort" function is <code>abort()</code>. + * + * The "abort" function is called when: + * + * <ul> + * <li>talloc_get_type_abort() fails</li> + * <li>the provided pointer is not a valid talloc context</li> + * <li>when the context meta data are invalid</li> + * <li>when access after free is detected</li> + * </ul> + * + * Example: + * + * @code + * void my_abort(const char *reason) + * { + * fprintf(stderr, "talloc abort: %s\n", reason); + * abort(); + * } + * + * talloc_set_abort_fn(my_abort); + * @endcode + * + * @param[in] abort_fn The new "abort" function. + * + * @see talloc_set_log_fn() + * @see talloc_get_type() + */ void talloc_set_abort_fn(void (*abort_fn)(const char *reason)); void talloc_set_log_fn(void (*log_fn)(const char *message)); void talloc_set_log_stderr(void); +/* @} ******************************************************************/ + #if TALLOC_DEPRECATED #define talloc_zero_p(ctx, type) talloc_zero(ctx, type) #define talloc_p(ctx, type) talloc(ctx, type) |