Blame malloc/mcheck.h

Packit Service 82fcde
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit Service 82fcde
   This file is part of the GNU C Library.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is free software; you can redistribute it and/or
Packit Service 82fcde
   modify it under the terms of the GNU Lesser General Public
Packit Service 82fcde
   License as published by the Free Software Foundation; either
Packit Service 82fcde
   version 2.1 of the License, or (at your option) any later version.
Packit Service 82fcde
Packit Service 82fcde
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service 82fcde
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 82fcde
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 82fcde
   Lesser General Public License for more details.
Packit Service 82fcde
Packit Service 82fcde
   You should have received a copy of the GNU Lesser General Public
Packit Service 82fcde
   License along with the GNU C Library; if not, see
Packit Service 82fcde
   <http://www.gnu.org/licenses/>.  */
Packit Service 82fcde
Packit Service 82fcde
#ifndef _MCHECK_H
Packit Service 82fcde
#define _MCHECK_H       1
Packit Service 82fcde
Packit Service 82fcde
#include <features.h>
Packit Service 82fcde
Packit Service 82fcde
__BEGIN_DECLS
Packit Service 82fcde
Packit Service 82fcde
/* Return values for `mprobe': these are the kinds of inconsistencies that
Packit Service 82fcde
   `mcheck' enables detection of.  */
Packit Service 82fcde
enum mcheck_status
Packit Service 82fcde
{
Packit Service 82fcde
  MCHECK_DISABLED = -1,         /* Consistency checking is not turned on.  */
Packit Service 82fcde
  MCHECK_OK,                    /* Block is fine.  */
Packit Service 82fcde
  MCHECK_FREE,                  /* Block freed twice.  */
Packit Service 82fcde
  MCHECK_HEAD,                  /* Memory before the block was clobbered.  */
Packit Service 82fcde
  MCHECK_TAIL                   /* Memory after the block was clobbered.  */
Packit Service 82fcde
};
Packit Service 82fcde
Packit Service 82fcde
Packit Service 82fcde
/* Activate a standard collection of debugging hooks.  This must be called
Packit Service 82fcde
   before `malloc' is ever called.  ABORTFUNC is called with an error code
Packit Service 82fcde
   (see enum above) when an inconsistency is detected.  If ABORTFUNC is
Packit Service 82fcde
   null, the standard function prints on stderr and then calls `abort'.  */
Packit Service 82fcde
extern int mcheck (void (*__abortfunc)(enum mcheck_status)) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Similar to `mcheck' but performs checks for all block whenever one of
Packit Service 82fcde
   the memory handling functions is called.  This can be very slow.  */
Packit Service 82fcde
extern int mcheck_pedantic (void (*__abortfunc)(enum mcheck_status)) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Force check of all blocks now.  */
Packit Service 82fcde
extern void mcheck_check_all (void);
Packit Service 82fcde
Packit Service 82fcde
/* Check for aberrations in a particular malloc'd block.  You must have
Packit Service 82fcde
   called `mcheck' already.  These are the same checks that `mcheck' does
Packit Service 82fcde
   when you free or reallocate a block.  */
Packit Service 82fcde
extern enum mcheck_status mprobe (void *__ptr) __THROW;
Packit Service 82fcde
Packit Service 82fcde
/* Activate a standard collection of tracing hooks.  */
Packit Service 82fcde
extern void mtrace (void) __THROW;
Packit Service 82fcde
extern void muntrace (void) __THROW;
Packit Service 82fcde
Packit Service 82fcde
__END_DECLS
Packit Service 82fcde
#endif /* mcheck.h */