Go to the source code of this file.
Defines | |
#define | KB_ALLOC(type, count) (type *)kb_alloc(sizeof(type)*(count)) |
#define | KB_REALLOC(ptr, type, count) (type *)kb_realloc((void*)ptr, sizeof(type)*(count)) |
#define | kb_free(ptr) free(ptr) |
Functions | |
void * | kb_alloc (unsigned long size) |
void * | kb_realloc (void *ptr, unsigned long size) |
#define KB_ALLOC | ( | type, | |||
count | ) | (type *)kb_alloc(sizeof(type)*(count)) |
Memory Allocator Helpers
Definition at line 19 of file kb_memory.h.
Referenced by kb_create_symbol_table(), kb_parse_alias(), kb_parse_config_file(), kb_parse_device(), kb_parse_register(), kb_parse_section(), knet_device_create(), knet_i2c_init(), knet_open(), knet_rs232_open(), ksock_add_command(), ksock_exec_command_pending(), and ksock_init().
#define kb_free | ( | ptr | ) | free(ptr) |
Definition at line 21 of file kb_memory.h.
Referenced by kb_destroy_symbol_table(), kb_get_arg(), kb_parse_config_file(), knet_device_destroy(), knet_exit(), knet_i2c_exit(), knet_i2c_init(), knet_open(), knet_rs232_close(), koa_sound_task(), ksock_send_answer(), and main().
#define KB_REALLOC | ( | ptr, | |||
type, | |||||
count | ) | (type *)kb_realloc((void*)ptr, sizeof(type)*(count)) |
void* kb_alloc | ( | unsigned long | size | ) |
This function allocates safely memory. Produces an fatal error when no more memory is available.
size | size in bytes |
Definition at line 21 of file kb_memory.c.
References KB_ERROR_NOMEM, and KB_FATAL.
Referenced by knet_init(), koa_net_playsound(), and main().
void* kb_realloc | ( | void * | ptr, | |
unsigned long | size | |||
) |
This function reallocates safely memory. Produces an fatal error when no more memory is available
ptr | Pointer to the block of memory to resize | |
size | New size of the memory block |
Definition at line 40 of file kb_memory.c.
References KB_ERROR_NOMEM, and KB_FATAL.
Referenced by knet_printf(), and knet_vprintf().