HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_MemUtil.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_MemUtil.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  *
10  * Memory utility functions, for doing various low-level memory
11  * operations. Currently only implemented for Linux.
12  *
13  */
14 #ifndef UT_MEM_UTIL_H
15 #define UT_MEM_UTIL_H
16 
17 #include "UT_API.h"
18 #include <SYS/SYS_Types.h>
19 #include <iosfwd>
20 #include <stddef.h>
21 
23  UT_MEM_ADVICE_NONE, // no advice.
24  UT_MEM_ADVICE_RANDOM, // random order access - don't fetch ahead.
25  UT_MEM_ADVICE_SEQ, // sequential access - fetch ahead aggresively.
26  UT_MEM_ADVICE_NEEDSOON, // fetch ahead.
27  UT_MEM_ADVICE_DONE // done with the memory for now.
28 };
29 
30 UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice);
31 
32 // like memset, except it'll work with any arbitrary byte size of data.
33 UT_API void UTmemsetChunk(void *dest, const void *value, exint valuesize,
34  exint ncopies);
35 
36 // attempts to return the actual # of bytes that malloc would return for a
37 // block of 'size' bytes.
38 UT_API size_t UTmallocSize(size_t size);
39 
40 UT_API void UTdumpHeap();
41 UT_API void UTdumpMemory(void *base);
42 
43 UT_API void UTdumpHeapSize(std::ostream &os);
44 
45 /// Attempt to free unused heap allocated memory.
47 
48 #endif
UT_API size_t UTmallocSize(size_t size)
UT_API void UTtrimUnusedHeapMemory()
Attempt to free unused heap allocated memory.
UTmemAdvice
Definition: UT_MemUtil.h:22
#define UT_API
Definition: UT_API.h:12
GLsizeiptr size
Definition: glcorearb.h:663
int64 exint
Definition: SYS_Types.h:115
UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice)
UT_API void UTdumpHeapSize(std::ostream &os)
UT_API void UTdumpHeap()
GLsizei const GLfloat * value
Definition: glcorearb.h:823
UT_API void UTmemsetChunk(void *dest, const void *value, exint valuesize, exint ncopies)
UT_API void UTdumpMemory(void *base)