#include <common/xroad_common_fwd.h>
#include <stdlib.h>
#include <stdint.h>
Go to the source code of this file.
◆ xroad_mem_calloc()
void* xroad_mem_calloc |
( |
xroad_mem_pool_t * |
pool, |
|
|
size_t |
nmemb, |
|
|
size_t |
size |
|
) |
| |
allocate (calloc like) space in memory pool or in glibc, and zero it
- Parameters
-
[in] | pool | - memory pool. If NuLL, glibc calloc used |
[in] | nmemb | - number of elements to allocate |
[in] | size | - size of member to allocate |
- Returns
- pointer to allocated memory, else failed
◆ xroad_mem_free()
void xroad_mem_free |
( |
xroad_mem_pool_t * |
pool, |
|
|
void * |
ptr |
|
) |
| |
free allocated memory in memory pool
- Parameters
-
[in] | ptr | - memory to free. If NULL, glibc free used |
◆ xroad_mem_malloc()
void* xroad_mem_malloc |
( |
xroad_mem_pool_t * |
pool, |
|
|
size_t |
size |
|
) |
| |
allocate (malloc like) space in memory pool or in glibc
- Parameters
-
[in] | pool | - memory pool, If NULL, glibc malloc used |
[in] | size | - size of member to allocate |
- Returns
- pointer to allocated memory, else failed
◆ xroad_mem_realloc()
void* xroad_mem_realloc |
( |
xroad_mem_pool_t * |
pool, |
|
|
void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
realloc memory chunk in memory pool or glibc
- Parameters
-
[in] | pool | - memory pool. If NULL glibc realloc used |
[in] | ptr | - memory to realloc |
[in] | size | - new memory chunk size |
- Returns
- reallocated memory chunk