Github User Fetcher 1.0.0
C Application with Server and GUI
|
Test intern memory managment. More...
Go to the source code of this file.
Functions | |
CR_BEGIN_C_API CR_API void * | cr_malloc (size_t size) |
CR_API void * | cr_calloc (size_t nmemb, size_t size) |
CR_API void * | cr_realloc (void *ptr, size_t size) |
CR_API void | cr_free (void *ptr) |
Test intern memory managment.
Definition in file alloc.h.
CR_API void * cr_calloc | ( | size_t | nmemb, |
size_t | size ) |
Allocates and zero-initialize a block of memory usable by the test.
It is undefined behaviour to access a pointer returned by calloc(3) inside a test or its setup and teardown functions; cr_calloc must be use in its place for this purpose.
This function is semantically identical to calloc(3).
[in] | nmemb | The number of elements to allocate |
[in] | size | The minimal size of each element. |
CR_API void cr_free | ( | void * | ptr | ) |
Free a block of memory allocated by cr_malloc, cr_free or cr_realloc.
[in] | ptr | A pointer to the memory that needs to be freed. |
CR_BEGIN_C_API CR_API void * cr_malloc | ( | size_t | size | ) |
Allocates a block of memory usable by the test.
It is undefined behaviour to access a pointer returned by malloc(3) inside a test or its setup and teardown functions; cr_malloc must be use in its place for this purpose.
This function is semantically identical to malloc(3).
[in] | size | The minimal size in bytes of the newly allocated memory. |
CR_API void * cr_realloc | ( | void * | ptr, |
size_t | size ) |
Reallocates a block of memory usable by the test.
It is undefined behaviour to access a pointer returned by realloc(3) inside a test or its setup and teardown functions; cr_realloc must be used in its place for this purpose.
This function is semantically identical to realloc(3).
[in] | ptr | A pointer to the memory that needs to be resized. |
[in] | size | The minimal size of the reallocated memory. |