|
| void | clear (void *addr, size_t size) |
| | Clears a memory block.
|
| |
| void | copy (void *to, const void *from, size_t size) |
| | Copies a memory block.
|
| |
| template<class FPTR = function_pointer> |
| pointer | function_pointer_to_generic_pointer (FPTR fptr) |
| | Converts a function pointer to a generic pointer.
|
| |
| template<class FPTR = function_pointer> |
| FPTR | generic_pointer_to_function_pointer (pointer ptr) |
| | Converts a generic pointer to a function pointer.
|
| |
| template<class FPTR = function_pointer> |
| FPTR | generic_pointer_to_function_pointer (void *ptr) |
| | Converts a generic pointer to a function pointer.
|
| |
| template<class T > |
| T & | pointer_as_reference (void *ptr) |
| | Converts a pointer to a reference.
|
| |
| template<class T > |
| const T & | pointer_as_reference (const void *ptr) |
| | Converts a const pointer to a reference.
|
| |
| void * | aligned_malloc (size_t size, size_t alignment=GEO_MEMORY_ALIGNMENT) |
| | Allocates aligned memory.
|
| |
| void | aligned_free (void *p) |
| | Deallocates aligned memory.
|
| |
| bool | is_aligned (void *p, size_t alignment=GEO_MEMORY_ALIGNMENT) |
| | Checks whether a pointer is aligned.
|
| |
| void * | align (void *p) |
| | Returns the smallest aligned memory address from p.
|
| |
| template<typename T1 , int A1, typename T2 , int A2> |
| bool | operator== (const aligned_allocator< T1, A1 > &, const aligned_allocator< T2, A2 > &) |
| | Tests whether two aligned_allocators are equal.
|
| |
| template<typename T1 , int A1, typename T2 , int A2> |
| bool | operator!= (const aligned_allocator< T1, A1 > &, const aligned_allocator< T2, A2 > &) |
| | Tests whether two aligned_allocators are different.
|
| |
Utilities for memory management.
template<class FPTR = function_pointer>
| pointer GEO::Memory::function_pointer_to_generic_pointer |
( |
FPTR |
fptr | ) |
|
|
inline |
Converts a function pointer to a generic pointer.
In C++ it is not legal to convert between function pointers and generic pointers using casts. Such conversion may be required when retrieving symbols in dynamically linked libraries, or when interfacing with scripting languages.
- Template Parameters
-
| FPTR | function pointer type |
- Parameters
-
| [in] | fptr | the function pointer |
- Returns
- a generic pointer with the same address as
fptr
Definition at line 147 of file memory.h.
template<class FPTR = function_pointer>
| FPTR GEO::Memory::generic_pointer_to_function_pointer |
( |
pointer |
ptr | ) |
|
|
inline |
Converts a generic pointer to a function pointer.
In C++ it is not legal to convert between function pointers and generic pointers using casts. Such conversion may be required when retrieving symbols in dynamically linked libraries, or when interfacing with scripting languages.
- Template Parameters
-
| FPTR | function pointer type |
- Parameters
-
| [in] | ptr | the generic pointer |
- Returns
- a function pointer with the same address as
ptr
Definition at line 166 of file memory.h.
template<class FPTR = function_pointer>
| FPTR GEO::Memory::generic_pointer_to_function_pointer |
( |
void * |
ptr | ) |
|
|
inline |
Converts a generic pointer to a function pointer.
In C++ it is not legal to convert between function pointers and generic pointers using casts. Such conversion may be required when retrieving symbols in dynamically linked libraries, or when interfacing with scripting languages.
- Template Parameters
-
| FPTR | function pointer type |
- Parameters
-
| [in] | ptr | the generic pointer |
- Returns
- a function pointer with the same address as
ptr
Definition at line 185 of file memory.h.