diff options
author | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
---|---|---|
committer | svn2git <svn2git@FreeBSD.org> | 1994-07-01 08:00:00 +0000 |
commit | 5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch) | |
tree | e779b5a6edddbb949b7990751b12d6f25304ba86 /lib/libmalloc/trace.h | |
parent | a16f65c7d117419bd266c28a1901ef129a337569 (diff) |
Diffstat (limited to 'lib/libmalloc/trace.h')
-rw-r--r-- | lib/libmalloc/trace.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/libmalloc/trace.h b/lib/libmalloc/trace.h new file mode 100644 index 0000000000000..c3826dceca4b9 --- /dev/null +++ b/lib/libmalloc/trace.h @@ -0,0 +1,19 @@ +#ifndef __TRACE_H__ +#define __TRACE_H__ +extern void __m_install_record proto((univptr_t, const char *)); +extern void __m_delete_record proto((univptr_t)); + +#define RECORD_FILE_AND_LINE(addr, fname, linenum) \ + if (_malloc_leaktrace) { \ + (void) sprintf(_malloc_statsbuf, "%s:%d:", fname, linenum); \ + __m_install_record(addr, _malloc_statsbuf); \ + } else \ + _malloc_leaktrace += 0 + +#define DELETE_RECORD(addr) \ + if (_malloc_leaktrace) \ + __m_delete_record(addr); \ + else \ + _malloc_leaktrace += 0 + +#endif /* __TRACE_H__ */ /* Do not add anything after this line */ |