1 /* Copyright (C) 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
26 #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
28 #define __P(args) args
30 #define __ptr_t void *
31 #else /* Not C++ or ANSI C. */
35 #define __ptr_t char *
36 #endif /* C++ or ANSI C. */
39 /* Return values for `mprobe': these are the kinds of inconsistencies that
40 `mcheck' enables detection of. */
43 MCHECK_DISABLED
= -1, /* Consistency checking is not turned on. */
44 MCHECK_OK
, /* Block is fine. */
45 MCHECK_FREE
, /* Block freed twice. */
46 MCHECK_HEAD
, /* Memory before the block was clobbered. */
47 MCHECK_TAIL
/* Memory after the block was clobbered. */
51 /* Activate a standard collection of debugging hooks. This must be called
52 before `malloc' is ever called. ABORTFUNC is called with an error code
53 (see enum above) when an inconsistency is detected. If ABORTFUNC is
54 null, the standard function prints on stderr and then calls `abort'. */
55 extern int mcheck
__P ((void (*__abortfunc
) __P ((enum mcheck_status
))));
57 /* Check for aberrations in a particular malloc'd block. You must have
58 called `mcheck' already. These are the same checks that `mcheck' does
59 when you free or reallocate a block. */
60 extern enum mcheck_status mprobe
__P ((__ptr_t __ptr
));
62 /* Activate a standard collection of tracing hooks. */
63 extern void mtrace
__P ((void));
64 extern void muntrace
__P ((void));