14 #ifndef STXXL_MALLOC_H
15 #define STXXL_MALLOC_H
25 #include <stxxl/bits/namespace.h>
28 __STXXL_BEGIN_NAMESPACE
36 #if !defined(__APPLE__) && !defined(__FreeBSD__)
39 typedef int return_type;
44 struct mallinfo info = mallinfo();
51 struct mallinfo info = mallinfo();
58 struct mallinfo info = mallinfo();
65 struct mallinfo info = mallinfo();
72 struct mallinfo info = mallinfo();
79 struct mallinfo info = mallinfo();
86 struct mallinfo info = mallinfo();
93 struct mallinfo info = mallinfo();
100 struct mallinfo info = mallinfo();
107 struct mallinfo info = mallinfo();
120 inline std::ostream & operator << (std::ostream & s,
const malloc_stats & st)
122 #if !defined(__APPLE__) && !defined(__FreeBSD__)
123 s <<
"MALLOC statistics" << std::endl;
124 s <<
"=================================================================" << std::endl;
125 s <<
"Space allocated from system not using mmap: " << st.
from_system_nmmap() <<
" bytes" << std::endl;
126 s <<
" number of free chunks : " << st.
free_chunks() << std::endl;
127 s <<
" space allocated and in use : " << st.
used() <<
" bytes" << std::endl;
128 s <<
" space allocated but not in use : " << st.
not_used() <<
" bytes" << std::endl;
129 s <<
" top-most, releasable (via malloc_trim) space: " << st.
releasable() <<
" bytes" << std::endl;
130 s <<
" maximum total allocated space (?) : " << st.
max_allocated() <<
" bytes" << std::endl;
131 s <<
" FASTBIN blocks " << std::endl;
132 s <<
" number of fastbin blocks: " << st.
fastbin_blocks() << std::endl;
133 s <<
" space available in freed fastbin blocks: " << st.
fastbin_free() <<
" bytes" << std::endl;
134 s <<
"Space allocated from system using mmap: " << st.
from_system_mmap() <<
" bytes" << std::endl;
135 s <<
" number of chunks allocated via mmap(): " << st.
mmap_chunks() << std::endl;
136 s <<
"Total space allocated from system (mmap and not mmap): " <<
138 s <<
"=================================================================" << std::endl;
140 s <<
"MALLOC statistics are not supported on this platform";
149 __STXXL_END_NAMESPACE
151 #endif // !STXXL_MALLOC_H