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 <SYS/SYS_Memory.h>
16 
19 
28 
29  UT_MEM_MAX_ENTRIES // Sentinal
30 };
31 
32 class UT_WorkBuffer;
33 
35 {
36 public:
37  SYS_MEMORY_SUBCLASS(static, , theUTMemoryTable)
38 
39  /// Print the memory in a "nice" (well at least standard) format. The
40  /// buffer passed in should be at least 80 characters long.
41  static void printMemory(char *buffer, const char *label,
42  size_t used, size_t peak,
43  int indent=3);
44 
45  /// Print an entire table of memory users. This printer assumes that
46  /// each user's label will fit into a 15 character buffer (for formatting)
47  /// The total memory accounted for is returned.
48  static size_t printMemory(UT_WorkBuffer &buffer,
50  int indent=3,
51  bool sort_by_peak=false);
52 
53 
54 private:
55  static SYS_MemoryTable theUTMemoryTable;
56 };
57 
58 #endif
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
UT_MemoryUser
Definition: UT_Memory.h:17
#define UT_API
Definition: UT_API.h:14
GLuint buffer
Definition: glcorearb.h:660
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
#define SYS_MEMORY_SUBCLASS(STATIC, prefix, table)
Definition: SYS_Memory.h:248