igraph_malloc — Allocate memory that can be safely deallocated by igraph functions.igraph_calloc — Allocate memory that can be safely deallocated by igraph functions.igraph_realloc — Reallocate memory that can be safely deallocated by igraph functions.igraph_free — Deallocate memory that was allocated by igraph functions.
void *igraph_malloc(size_t size);
This function behaves like malloc(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
Arguments:
|
Number of bytes to be allocated. Zero is treated as one byte. |
Returns:
Pointer to the piece of allocated memory; |
See also:
void *igraph_calloc(size_t count, size_t size);
This function behaves like calloc(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
Arguments:
|
Number of items to be allocated. |
|
Size of a single item to be allocated. |
Returns:
Pointer to the piece of allocated memory; |
See also:
void *igraph_realloc(void* ptr, size_t size);
This function behaves like realloc(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
Arguments:
|
The pointer to reallocate. |
|
Number of bytes to be allocated. |
Returns:
Pointer to the piece of allocated memory; |
See also:
| ← Chapter 5. Error handling | Chapter 7. Data structure library: vector, matrix, other data types → |