Go to the source code of this file.
|
SAL_DLLPUBLIC void * | rtl_allocateMemory (sal_Size Bytes) SAL_THROW_EXTERN_C() |
| Allocate memory. More...
|
|
SAL_DLLPUBLIC void * | rtl_reallocateMemory (void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C() |
| Reallocate memory. More...
|
|
SAL_DLLPUBLIC void | rtl_freeMemory (void *Ptr) SAL_THROW_EXTERN_C() |
| Free memory. More...
|
|
SAL_DLLPUBLIC void * | rtl_allocateZeroMemory (sal_Size Bytes) SAL_THROW_EXTERN_C() |
| Allocate and zero memory. More...
|
|
SAL_DLLPUBLIC void | rtl_freeZeroMemory (void *Ptr, sal_Size Bytes) SAL_THROW_EXTERN_C() |
| Zero and free memory. More...
|
|
SAL_DLLPUBLIC void * | rtl_allocateAlignedMemory (sal_Size Alignment, sal_Size Bytes) SAL_THROW_EXTERN_C() |
| Allocate aligned memory. More...
|
|
SAL_DLLPUBLIC void | rtl_freeAlignedMemory (void *Ptr) SAL_THROW_EXTERN_C() |
| Free memory allocated with rtl_allocateAlignedMemory. More...
|
|
SAL_DLLPUBLIC rtl_arena_type * | rtl_arena_create (const char *pName, sal_Size quantum, sal_Size quantum_cache_max, rtl_arena_type *source_arena, void *(*source_alloc)(rtl_arena_type *, sal_Size *), void(*source_free)(rtl_arena_type *, void *, sal_Size), int nFlags) SAL_THROW_EXTERN_C() |
| rtl_arena_create() More...
|
|
SAL_DLLPUBLIC void | rtl_arena_destroy (rtl_arena_type *pArena) SAL_THROW_EXTERN_C() |
| rtl_arena_destroy() More...
|
|
SAL_DLLPUBLIC void * | rtl_arena_alloc (rtl_arena_type *pArena, sal_Size *pBytes) SAL_THROW_EXTERN_C() |
| rtl_arena_alloc() More...
|
|
SAL_DLLPUBLIC void | rtl_arena_free (rtl_arena_type *pArena, void *pAddr, sal_Size nBytes) SAL_THROW_EXTERN_C() |
| rtl_arena_free() More...
|
|
SAL_DLLPUBLIC rtl_cache_type * | rtl_cache_create (const char *pName, sal_Size nObjSize, sal_Size nObjAlign, int(*constructor)(void *pObj, void *pUserArg), void(*destructor)(void *pObj, void *pUserArg), void(*reclaim)(void *pUserArg), void *pUserArg, rtl_arena_type *pSource, int nFlags) SAL_THROW_EXTERN_C() |
| rtl_cache_create() More...
|
|
SAL_DLLPUBLIC void | rtl_cache_destroy (rtl_cache_type *pCache) SAL_THROW_EXTERN_C() |
| rtl_cache_destroy() More...
|
|
SAL_DLLPUBLIC void * | rtl_cache_alloc (rtl_cache_type *pCache) SAL_THROW_EXTERN_C() |
| rtl_cache_alloc() More...
|
|
SAL_DLLPUBLIC void | rtl_cache_free (rtl_cache_type *pCache, void *pObj) SAL_THROW_EXTERN_C() |
| rtl_cache_free() More...
|
|
#define RTL_ARENA_NAME_LENGTH 31 |
#define RTL_CACHE_FLAG_BULKDESTROY 1 |
#define RTL_CACHE_NAME_LENGTH 31 |
SAL_DLLPUBLIC void* rtl_allocateAlignedMemory |
( |
sal_Size |
Alignment, |
|
|
sal_Size |
Bytes |
|
) |
| |
Allocate aligned memory.
A call to this function will return NULL upon the requested memory size being either zero or larger than currently allocatable.
Memory obtained through this function must be freed with rtl_freeAlignedMemory.
- Parameters
-
Alignment | [in] alignment in bytes, must be a power of two multiple of sizeof(void*). |
Bytes | [in] memory size. |
- Returns
- pointer to allocated memory.
- Since
- LibreOffice 4.3
Allocate memory.
A call to this function will return NULL upon the requested memory size being either zero or larger than currently allocatable.
- Parameters
-
- Returns
- pointer to allocated memory.
Allocate and zero memory.
A call to this function will return NULL upon the requested memory size being either zero or larger than currently allocatable.
- Parameters
-
- Returns
- pointer to allocated and zero'ed memory.
rtl_arena_alloc()
- Parameters
-
pArena | [in] arena from which resource is allocated. |
pBytes | [inout] size of resource to allocate. |
- Returns
- allocated resource, or NULL upon failure.
- See also
- rtl_arena_free()
rtl_arena_create()
- Parameters
-
pName | [in] descriptive name; for debugging purposes. |
quantum | [in] resource allocation unit / granularity; rounded up to next power of 2. |
quantum_cache_max | [in] max resources to cache; rounded up to next multiple of quantum; usually 0. |
source_arena | [in] passed as argument to source_alloc, source_free; usually NULL. |
source_alloc | [in] function to allocate resources; usually rtl_arena_alloc. |
source_free | [in] function to free resources; usually rtl_arena_free. |
nFlags | [in] flags; usually 0. |
- Returns
- pointer to rtl_arena_type, or NULL upon failure.
- See also
- rtl_arena_destroy()
rtl_arena_free()
- Parameters
-
pArena | [in] arena from which resource was allocated. |
pAddr | [in] resource to free. |
nBytes | [in] size of resource. |
- Returns
- None.
- See also
- rtl_arena_alloc()
rtl_cache_alloc()
- Parameters
-
pCache | [in] cache from which object is allocated. |
- Returns
- pointer to allocated object, or NULL upon failure.
SAL_DLLPUBLIC rtl_cache_type* rtl_cache_create |
( |
const char * |
pName, |
|
|
sal_Size |
nObjSize, |
|
|
sal_Size |
nObjAlign, |
|
|
int(*)(void *pObj, void *pUserArg) |
constructor, |
|
|
void(*)(void *pObj, void *pUserArg) |
destructor, |
|
|
void(*)(void *pUserArg) |
reclaim, |
|
|
void * |
pUserArg, |
|
|
rtl_arena_type * |
pSource, |
|
|
int |
nFlags |
|
) |
| |
rtl_cache_create()
- Parameters
-
pName | [in] descriptive name; for debugging purposes. |
nObjSize | [in] object size. |
nObjAlign | [in] object alignment; usually 0 for suitable default. |
constructor | [in] object constructor callback function; returning 1 for success or 0 for failure. |
destructor | [in] object destructor callback function. |
reclaim | [in] reclaim callback function. |
pUserArg | [in] opaque argument passed to callback functions. |
pSource | [in] opaque argument passed to callback functions. |
nFlags | [in] flags. |
- Returns
- pointer to rtl_cache_type, or NULL upon failure.
- See also
- rtl_cache_destroy()
Free memory allocated with rtl_allocateAlignedMemory.
- Parameters
-
Ptr | [in] pointer to previously allocated memory. |
- Returns
- none. Memory is released. Ptr is invalid.
- Since
- LibreOffice 4.3
Free memory.
- Parameters
-
Ptr | [in] pointer to previously allocated memory. |
- Returns
- none. Memory is released. Ptr is invalid.
SAL_DLLPUBLIC void rtl_freeZeroMemory |
( |
void * |
Ptr, |
|
|
sal_Size |
Bytes |
|
) |
| |
Zero and free memory.
- Parameters
-
Ptr | [in] pointer to previously allocated memory. |
Bytes | [in] memory size. |
- Returns
- none. Memory is zero'ed and released. Ptr is invalid.
SAL_DLLPUBLIC void* rtl_reallocateMemory |
( |
void * |
Ptr, |
|
|
sal_Size |
Bytes |
|
) |
| |
Reallocate memory.
A call to this function with parameter 'Ptr' being NULL is equivalent to a rtl_allocateMemory() call. A call to this function with parameter 'Bytes' being 0 is equivalent to a rtl_freeMemory() call.
- See also
- rtl_allocateMemory()
-
rtl_freeMemory()
- Parameters
-
Ptr | [in] pointer to previously allocated memory. |
Bytes | [in] new memory size. |
- Returns
- pointer to reallocated memory. May differ from Ptr.