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