#include <stdlib.h>
Go to the source code of this file.
Typedefs | |
| typedef void *(* | ks_malloc_t )(size_t) |
| typedef void *(* | ks_realloc_t )(void *, size_t) |
| typedef void(* | ks_free_t )(void *) |
Functions | |
| void | ks_malloc_set (ks_malloc_t, ks_realloc_t, ks_free_t) |
| void * | ks_malloc (size_t) |
| void * | ks_realloc (void *, size_t) |
| void | ks_free (void *) |
Type and function declarations for the functions defined in ks_malloc.c. Do not include this header file directly in applications; instead, include the application header file ks.h which will include all the libkarmaclient header files htat you need.
Definition in file ks_malloc.h.
|
|
A pointer to a function with the same prototype as free(3). Objects of this type are used by ks_free() to return memory to the system once libkarmaclient has finished with it. Definition at line 59 of file ks_malloc.h. |
|
|
A pointer to a function with the same prototype as malloc(3). Objects of this type are used by ks_malloc() to allocate memory for libkarmaclient objects. The actual function to be used is set using ks_malloc_set(). Definition at line 44 of file ks_malloc.h. |
|
|
A pointer to a function with the same prototype as realloc(3). Objects of this type are used by ks_realloc() to allocate memory for libkarmaclient objects. The actual function to be used is set using ks_malloc_set(). Definition at line 52 of file ks_malloc.h. |
|
|
Free the memory pointed to by ptr.
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(). |
|
|
Allocate a size bytes of memory using the allocation function given to ks_malloc_set().
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(). |
|
||||||||||||||||
|
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).
Definition at line 75 of file ks_malloc.c. |
|
||||||||||||
|
Allocate a new block of size bytes memory for the object pointed to be ptr.
Definition at line 109 of file ks_malloc.c. Referenced by ks_array_extend(), and ks_string_append(). |
1.4.4