Functions having to do with memory allocation/handling.
More...
|
file | align.h |
| Provide architecture-specific memory-alignment information.
|
|
file | mallocHook.h |
| Routines for controlling malloc behavior.
|
|
Functions having to do with memory allocation/handling.
#define ARCH_CACHE_LINE_SIZE |
The size of a CPU cache line on the current processor architecture in bytes.
Definition at line 83 of file align.h.
#define ARCH_MAX_ALIGNMENT_INCREASE |
Maximum extra space needed for alignment.
The ArchAlignMemorySize()
can increase the required memory by no more than ARCH_MAX_ALIGNMENT_INCREASE
.
Definition at line 63 of file align.h.
void* ArchAlignMemory |
( |
void * |
base | ) |
|
|
inline |
Align memory to the next "best" alignment value.
This will take a pointer and bump it to the next ideal alignment boundary that will work for all data types.
Definition at line 71 of file align.h.
size_t ArchAlignMemorySize |
( |
size_t |
nBytes | ) |
|
|
inline |
Return suitably aligned memory size.
Requests to malloc()
or ::new
for a given size are often rounded upward. Given a request for nBytes
bytes of storage, this function returns the amount that would actually be consumed by the system to satisfy it. This is needed for efficient user-defined memory management.
Definition at line 53 of file align.h.
ARCH_API bool ArchIsPtmallocActive |
( |
| ) |
|
Return true if ptmalloc is being used as the memory allocator.
ptmalloc3 is an external shared library providing implementations of the standard memory allocation functions (e.g. malloc, free). Consumers with special behavior that depends on this library may use this function to determine if it is the active allocator.
ARCH_API bool ArchIsStlAllocatorOff |
( |
| ) |
|
Return true if the C++ STL allocator was requested to be turned off.
Under gcc, this is done by setting the environment variable GLIBCXX_FORCE_NEW, but it might differ (or not even be possible) for other platforms.