HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Memory.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_Memory.h ( UT Library, C++)
7  *
8  * COMMENTS: Memory tracking utilities
9  */
10 
11 #ifndef __UT_Memory__
12 #define __UT_Memory__
13 
14 #include "UT_API.h"
15 #include "UT_MemoryTable.h"
16 
17 #include <SYS/SYS_AtomicInt.h>
18 #include <SYS/SYS_Types.h>
19 #include <cstddef>
20 
22 {
24 
33 
34  UT_MEM_MAX_ENTRIES // Sentinal
35 };
36 
37 class UT_WorkBuffer;
38 
40 {
41 public:
42  UT_MEMORY_SUBCLASS(static, , theUTMemoryTable)
43 
44  /// Print the memory in a "nice" (well at least standard) format. The
45  /// buffer passed in should be at least 80 characters long.
46  static void printMemory(char *buffer, const char *label,
47  size_t used, size_t peak,
48  int indent=3);
49 
50  /// Print an entire table of memory users. This printer assumes that
51  /// each user's label will fit into a 15 character buffer (for formatting)
52  /// The total memory accounted for is returned.
53  static size_t printMemory(UT_WorkBuffer &buffer,
55  int indent=3,
56  bool sort_by_peak=false);
57 
58 
59 private:
60  static UT_MemoryTable theUTMemoryTable;
61 };
62 
63 #endif
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
#define UT_API
Definition: UT_API.h:14
GLuint buffer
Definition: glcorearb.h:660
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
#define UT_MEMORY_SUBCLASS(STATIC, prefix, table)
UT_MemoryUserEnum
Definition: UT_Memory.h:21