HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 <stddef.h>
20 
22  UT_MEM_ADVICE_NONE, // no advice.
23  UT_MEM_ADVICE_RANDOM, // random order access - don't fetch ahead.
24  UT_MEM_ADVICE_SEQ, // sequential access - fetch ahead aggresively.
25  UT_MEM_ADVICE_NEEDSOON, // fetch ahead.
26  UT_MEM_ADVICE_DONE // done with the memory for now.
27 };
28 
29 UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice);
30 
31 // like memset, except it'll work with any arbitrary byte size of data.
32 UT_API void UTmemsetChunk(void *dest, const void *value, exint valuesize,
33  exint ncopies);
34 
35 // attempts to return the actual # of bytes that malloc would return for a
36 // block of 'size' bytes.
37 UT_API size_t UTmallocSize(size_t size);
38 
39 UT_API void UTdumpHeap();
40 UT_API void UTdumpMemory(void *base);
41 
42 /// Attempt to free unused heap allocated memory.
44 
45 #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:21
int64 exint
Definition: SYS_Types.h:125
#define UT_API
Definition: UT_API.h:14
UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice)
UT_API void UTdumpHeap()
GLsizeiptr size
Definition: glcorearb.h:664
UT_API void UTmemsetChunk(void *dest, const void *value, exint valuesize, exint ncopies)
Definition: core.h:1131
UT_API void UTdumpMemory(void *base)
Definition: format.h:2459