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
return_type releasable() const
Top-most, releasable (via malloc_trim) space (bytes)
Definition: malloc.h:70
return_type from_system_total() const
Returns total number of bytes allocated from system including mmapped regions.
Definition: malloc.h:112
Access to some useful malloc statistics.
Definition: malloc.h:34
return_type fastbin_free() const
Space available in freed fastbin blocks (bytes)
Definition: malloc.h:91
return_type fastbin_blocks() const
Number of fastbin blocks.
Definition: malloc.h:84
return_type used() const
Number of bytes allocated and in use.
Definition: malloc.h:56
return_type from_system_mmap() const
Returns number of bytes allocated from system using mmap.
Definition: malloc.h:98
return_type max_allocated() const
Maximum total allocated space (bytes) (always 0 ?)
Definition: malloc.h:77
return_type free_chunks() const
Returns number of free chunks.
Definition: malloc.h:49
return_type from_system_nmmap() const
Returns number of bytes allocated from system not including mmapped regions.
Definition: malloc.h:42
return_type not_used() const
Number of bytes allocated but not in use.
Definition: malloc.h:63
return_type mmap_chunks() const
Number of chunks allocated via mmap()
Definition: malloc.h:105