HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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
21
enum
UTmemAdvice
{
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.
43
UT_API
void
UTtrimUnusedHeapMemory
();
44
45
#endif
UTmallocSize
UT_API size_t UTmallocSize(size_t size)
UTtrimUnusedHeapMemory
UT_API void UTtrimUnusedHeapMemory()
Attempt to free unused heap allocated memory.
UT_MEM_ADVICE_DONE
Definition:
UT_MemUtil.h:26
UTmemAdvice
UTmemAdvice
Definition:
UT_MemUtil.h:21
exint
int64 exint
Definition:
SYS_Types.h:125
UT_MEM_ADVICE_RANDOM
Definition:
UT_MemUtil.h:23
UT_API.h
UT_API
#define UT_API
Definition:
UT_API.h:14
UT_MEM_ADVICE_NONE
Definition:
UT_MemUtil.h:22
SYS_Types.h
UTmemAdvise
UT_API int UTmemAdvise(void *mem, size_t bytes, UTmemAdvice advice)
UTdumpHeap
UT_API void UTdumpHeap()
size
GLsizeiptr size
Definition:
glcorearb.h:664
UT_MEM_ADVICE_NEEDSOON
Definition:
UT_MemUtil.h:25
UT_MEM_ADVICE_SEQ
Definition:
UT_MemUtil.h:24
UTmemsetChunk
UT_API void UTmemsetChunk(void *dest, const void *value, exint valuesize, exint ncopies)
value
Definition:
core.h:1131
UTdumpMemory
UT_API void UTdumpMemory(void *base)
bytes
Definition:
format.h:2459
UT
UT_MemUtil.h
Generated on Tue Dec 17 2024 03:42:14 for HDK by
1.8.6