1*b5677b36Schristos /* $NetBSD: memcluster.h,v 1.1.1.1 2009/04/12 15:33:33 christos Exp $ */ 2*b5677b36Schristos 3*b5677b36Schristos /* 4*b5677b36Schristos * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 5*b5677b36Schristos * Copyright (c) 1997,1999 by Internet Software Consortium. 6*b5677b36Schristos * 7*b5677b36Schristos * Permission to use, copy, modify, and distribute this software for any 8*b5677b36Schristos * purpose with or without fee is hereby granted, provided that the above 9*b5677b36Schristos * copyright notice and this permission notice appear in all copies. 10*b5677b36Schristos * 11*b5677b36Schristos * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 12*b5677b36Schristos * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13*b5677b36Schristos * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 14*b5677b36Schristos * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15*b5677b36Schristos * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16*b5677b36Schristos * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 17*b5677b36Schristos * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18*b5677b36Schristos */ 19*b5677b36Schristos 20*b5677b36Schristos #ifndef MEMCLUSTER_H 21*b5677b36Schristos #define MEMCLUSTER_H 22*b5677b36Schristos 23*b5677b36Schristos #include <stdio.h> 24*b5677b36Schristos 25*b5677b36Schristos #define meminit __meminit 26*b5677b36Schristos #ifdef MEMCLUSTER_DEBUG 27*b5677b36Schristos #define memget(s) __memget_debug(s, __FILE__, __LINE__) 28*b5677b36Schristos #define memput(p, s) __memput_debug(p, s, __FILE__, __LINE__) 29*b5677b36Schristos #else /*MEMCLUSTER_DEBUG*/ 30*b5677b36Schristos #ifdef MEMCLUSTER_RECORD 31*b5677b36Schristos #define memget(s) __memget_record(s, __FILE__, __LINE__) 32*b5677b36Schristos #define memput(p, s) __memput_record(p, s, __FILE__, __LINE__) 33*b5677b36Schristos #else /*MEMCLUSTER_RECORD*/ 34*b5677b36Schristos #define memget __memget 35*b5677b36Schristos #define memput __memput 36*b5677b36Schristos #endif /*MEMCLUSTER_RECORD*/ 37*b5677b36Schristos #endif /*MEMCLUSTER_DEBUG*/ 38*b5677b36Schristos #define memstats __memstats 39*b5677b36Schristos #define memactive __memactive 40*b5677b36Schristos 41*b5677b36Schristos int meminit(size_t, size_t); 42*b5677b36Schristos void * __memget(size_t); 43*b5677b36Schristos void __memput(void *, size_t); 44*b5677b36Schristos void * __memget_debug(size_t, const char *, int); 45*b5677b36Schristos void __memput_debug(void *, size_t, const char *, int); 46*b5677b36Schristos void * __memget_record(size_t, const char *, int); 47*b5677b36Schristos void __memput_record(void *, size_t, const char *, int); 48*b5677b36Schristos void memstats(FILE *); 49*b5677b36Schristos int memactive(void); 50*b5677b36Schristos 51*b5677b36Schristos #endif /* MEMCLUSTER_H */ 52*b5677b36Schristos /*! \file */ 53