#include "ks_config.h"
#include "ks_malloc.h"
#include <stdlib.h>
Go to the source code of this file.
Functions | |
| void | ks_malloc_set (ks_malloc_t m, ks_realloc_t r, ks_free_t f) |
| void * | ks_malloc (size_t size) |
| void * | ks_realloc (void *ptr, size_t size) |
| void | ks_free (void *ptr) |
Definitions of the libkarmaclient memory management functions. These functions provide wrappers around memory management functions that share the malloc(3), realloc(3) and free(3) prototypes.
Definition in file ks_malloc.c.
| void ks_free | ( | void * | ptr | ) |
Free the memory pointed to by ptr.
| ptr | a pointer to the memory we want to free |
Definition at line 122 of file ks_malloc.c.
Referenced by ks_array_fini(), ks_array_free(), ks_assoc_free(), ks_bquery_free(), ks_number_free(), ks_response_free(), ks_socket_free(), ks_socket_send(), ks_socket_set_auth(), and ks_string_free().
| void* ks_malloc | ( | size_t | size | ) |
Allocate a size bytes of memory using the allocation function given to ks_malloc_set().
| size | the size of the block of memory to be allocated (in bytes) |
Definition at line 92 of file ks_malloc.c.
Referenced by ks_array_init(), ks_array_new(), ks_assoc_new(), ks_bquery_new(), ks_number_new(), ks_socket_new(), ks_socket_send(), ks_socket_set_auth(), and ks_string_new().
| void ks_malloc_set | ( | ks_malloc_t | m, | |
| ks_realloc_t | r, | |||
| ks_free_t | f | |||
| ) |
Initialise the functions that are actually used for allocating reallocating and freeing allocated memory. If this function is not called, libkarmaclient defaults to using malloc(3), realloc(3) and free(3).
| m | a pointer to a memory allocation function. | |
| r | a pointer to a reallocation function. | |
| f | a pointer to a memory freeing function |
Definition at line 75 of file ks_malloc.c.
| void* ks_realloc | ( | void * | ptr, | |
| size_t | size | |||
| ) |
Allocate a new block of size bytes memory for the object pointed to be ptr.
| ptr | a pointer to the memory currently allocated for the object. | |
| size | the size of the block of memory we wish to allocate for the object pointed to by ptr. |
Definition at line 109 of file ks_malloc.c.
Referenced by ks_array_extend(), and ks_string_append().
1.5.1