#include <stdlib.h>
Include dependency graph for dbg_mem.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | DEBUG_MALLOC malloc |
#define | DEBUG_CALLOC calloc |
#define | DEBUG_REALLOC realloc |
#define | DEBUG_FREE free |
Functions | |
void * | debug_malloc (const char *file, int line, size_t) |
void * | debug_calloc (const char *file, int line, size_t, size_t) |
void * | debug_realloc (const char *file, int line, void *, size_t) |
void | debug_free (void *) |
void | disable_debug_memory () |
void | enable_debug_memory () |
void | clear_dbg_mem_list () |
void | print_dbg_mem_list () |
Variables | |
int | log_debug_mem_list |
int | print_debug_mem_calls |
int | next_log_debug_id |
|
|
Definition at line 50 of file dbg_mem.h. Referenced by rcs_shm_open(), and table_add().
|
|
|
|
Definition at line 53 of file dbg_mem.h. Referenced by bbdDelete(), bbdDeleteWriterStruct(), NML_SERVER_LOCAL_PORT::blocking_read(), clean_prev_read_info(), convert_print_list_to_lines(), corrected_free(), RCS_LINKED_LIST::delete_current_node(), RCS_LINKED_LIST::delete_node(), RCS_LINKED_LIST::flush_list(), freeDMAInfo(), free_recvmsg_collection_buffer(), free_sendmsg_collection_buffer(), getDMAInfo(), CMS_SERVER::initialize_write_request_space(), NML::operator delete(), CMS::operator delete(), rcs_sem_close(), rcs_sem_create(), rcs_sem_open(), rcs_shm_close(), rcs_shm_delete(), recvline(), recvmsgt_implementation(), RCS_LINKED_LIST::retrieve_head(), RCS_LINKED_LIST::retrieve_tail(), sendmsgt(), CMS_UPDATER::set_encoded_data(), CMS::set_encoded_data(), table_add(), table_delete(), update_lines_table(), CMS::~CMS(), CMS_SERVER::~CMS_SERVER(), NML_QR_SERVER::~NML_QR_SERVER(), and RCS_TIMER::~RCS_TIMER().
|
|
Definition at line 115 of file dbg_mem.cc. 00116 { 00117 void *ret = malloc (s); 00118 if (log_debug_mem_list) 00119 { 00120 add_dbg_mem_list (file, line, ret, s); 00121 } 00122 if (print_debug_mem_calls) 00123 { 00124 rcs_print ("%p = malloc(%d)\n", ret, s); 00125 } 00126 return ret; 00127 } |
|
Definition at line 130 of file dbg_mem.cc. |
|
Definition at line 145 of file dbg_mem.cc. 00146 { 00147 void *orig_ptr = ptr; 00148 if (log_debug_mem_list) 00149 { 00150 delete_dbg_mem_list (orig_ptr); 00151 } 00152 void *new_ptr = NULL; 00153 new_ptr = realloc (ptr, s); 00154 if (log_debug_mem_list) 00155 { 00156 add_dbg_mem_list (file, line, new_ptr, s); 00157 } 00158 if (print_debug_mem_calls) 00159 { 00160 rcs_print ("%p = realloc(%p,%d)\n", new_ptr, orig_ptr, s); 00161 } 00162 return new_ptr; 00163 } |
|
Definition at line 166 of file dbg_mem.cc. 00167 { 00168 if (print_debug_mem_calls) 00169 { 00170 rcs_print ("free(%p)\n", ptr); 00171 } 00172 if (log_debug_mem_list) 00173 { 00174 delete_dbg_mem_list (ptr); 00175 } 00176 if (NULL != ptr) 00177 { 00178 free (ptr); 00179 } 00180 } |
|
Definition at line 34 of file dbg_mem.cc. 00035 { 00036 log_debug_mem_list = 0; 00037 print_debug_mem_calls = 0; 00038 next_log_debug_id = 0; 00039 } |
|
Definition at line 26 of file dbg_mem.cc. 00027 { 00028 log_debug_mem_list = 1; 00029 print_debug_mem_calls = 1; 00030 next_log_debug_id = 0; 00031 } |
|
Definition at line 43 of file dbg_mem.cc. 00044 { 00045 log_debug_mem_list = 0; 00046 next_log_debug_id = 0; 00047 if (NULL != dbg_mem_list) 00048 { 00049 delete dbg_mem_list; 00050 dbg_mem_list = NULL; 00051 } 00052 } |
|
Definition at line 55 of file dbg_mem.cc. 00056 { 00057 if (NULL == dbg_mem_list) 00058 { 00059 rcs_print ("Debug memory list is NULL.\n"); 00060 return; 00061 } 00062 rcs_print ("\tAddress \tsize \tid \tFile \tline\n"); 00063 DEBUG_MEM_ENTRY *dbg_mem_entry = 00064 (DEBUG_MEM_ENTRY *) dbg_mem_list->get_head (); 00065 while (NULL != dbg_mem_entry) 00066 { 00067 rcs_print ("%p \t%d(0x%X) \t%d \t%s \t%d\n", dbg_mem_entry->address, 00068 dbg_mem_entry->size, dbg_mem_entry->size, dbg_mem_entry->id, 00069 dbg_mem_entry->file, dbg_mem_entry->line); 00070 dbg_mem_entry = (DEBUG_MEM_ENTRY *) dbg_mem_list->get_next (); 00071 } 00072 } |
|
|
|
|
|
|