remove unnecessary rlim64_t casts of 0
[unleashed.git] / include / malloc.h
blob86b7c9aa14c1e9cb498bdcdf86542691765d5063
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
25 /* Copyright (c) 1988 AT&T */
26 /* All Rights Reserved */
28 #ifndef _MALLOC_H
29 #define _MALLOC_H
31 #include <sys/types.h>
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
38 * Constants defining mallopt operations
40 #define M_MXFAST 1 /* set size of blocks to be fast */
41 #define M_NLBLKS 2 /* set number of block in a holding block */
42 #define M_GRAIN 3 /* set number of sizes mapped to one, for */
43 /* small blocks */
44 #define M_KEEP 4 /* retain contents of block after a free */
45 /* until another allocation */
47 * structure filled by
49 struct mallinfo {
50 unsigned long arena; /* total space in arena */
51 unsigned long ordblks; /* number of ordinary blocks */
52 unsigned long smblks; /* number of small blocks */
53 unsigned long hblks; /* number of holding blocks */
54 unsigned long hblkhd; /* space in holding block headers */
55 unsigned long usmblks; /* space in small blocks in use */
56 unsigned long fsmblks; /* space in free small blocks */
57 unsigned long uordblks; /* space in ordinary blocks in use */
58 unsigned long fordblks; /* space in free ordinary blocks */
59 unsigned long keepcost; /* cost of enabling keep option */
62 #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
63 defined(_XPG3)
64 #if __cplusplus >= 199711L
65 namespace std {
66 #endif
68 void *malloc(size_t);
69 void free(void *);
70 void freezero(void *, size_t);
71 void *realloc(void *, size_t);
72 void *reallocarray(void *, size_t, size_t);
73 void *recallocarray(void *, size_t, size_t, size_t);
74 void *calloc(size_t, size_t);
76 #if __cplusplus >= 199711L
77 } /* end of namespace std */
79 using std::malloc;
80 using std::free;
81 using std::realloc;
82 using std::calloc;
83 #endif /* __cplusplus >= 199711L */
84 #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || ... */
86 int mallopt(int, int);
87 struct mallinfo mallinfo(void);
89 #ifdef __cplusplus
91 #endif
93 #endif /* _MALLOC_H */