HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ArenaInfo.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_ArenaInfo.h
7  *
8  * COMMENTS:
9  * This is a simple interface to mallinfo or some alternative
10  * if this is not available.
11  */
12 
13 #ifndef __UT_ArenaInfo__
14 #define __UT_ArenaInfo__
15 
16 #include "UT_API.h"
17 #include <stddef.h>
18 #include <iosfwd>
19 
20 class UT_WorkBuffer;
21 
23 {
24 public:
25  // Arena size is a bit old school. Just use totalInUse.
26  static size_t arenaSize();
27  static size_t totalInUse();
28 
29  /// Print memory/arena usage to the stream (with a terminating new line)
30  static void outputUsage(std::ostream &os, bool output_in_bytes=false);
31 
32  /// Print memory usage into a work buffer (without terminating new line)
33  static void outputUsage(UT_WorkBuffer &wbuf, bool in_bytes=false);
34 
35  /// Returns true if the current session has successfully bound
36  /// JE Malloc.
37  static bool usingJEMalloc();
38 
39  /// Set our config options for jemalloc. Note that this should be (re)done
40  /// after forking since some options may be reset.
41  static void configureJEMalloc();
42 };
43 
44 #endif /* __UT_ArenaInfo__ */
#define UT_API
Definition: UT_API.h:14