diff options
author | unknown <monty@mashka.mysql.fi> | 2004-02-22 09:50:59 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2004-02-22 09:50:59 +0200 |
commit | 192bf819eb2bb91e383327d3bde6f596c20a82db (patch) | |
tree | dceddcd17cf1278b50f8838476df5644f764efe9 /innobase/mem | |
parent | 984750e13ef4a559c5da05b5fbd6fa363d3650b2 (diff) | |
parent | 522e83b64ab46d400ccb6aa8d7b749eefc28f4d5 (diff) | |
download | mariadb-git-192bf819eb2bb91e383327d3bde6f596c20a82db.tar.gz |
merge with 4.0
BitKeeper/etc/ignore:
auto-union
VC++Files/comp_err/comp_err.dsp:
Auto merged
VC++Files/my_print_defaults/my_print_defaults.dsp:
Auto merged
VC++Files/myisampack/myisampack.dsp:
Auto merged
acinclude.m4:
Auto merged
innobase/buf/buf0buf.c:
Auto merged
innobase/com/com0shm.c:
Auto merged
innobase/data/data0data.c:
Auto merged
innobase/ha/ha0ha.c:
Auto merged
innobase/include/buf0buf.ic:
Auto merged
innobase/include/dict0dict.h:
Auto merged
innobase/include/ibuf0ibuf.h:
Auto merged
innobase/include/lock0lock.h:
Auto merged
innobase/include/mtr0log.h:
Auto merged
innobase/include/mtr0mtr.h:
Auto merged
innobase/include/os0proc.h:
Auto merged
innobase/include/os0thread.h:
Auto merged
innobase/include/srv0srv.h:
Auto merged
innobase/include/sync0sync.h:
Auto merged
innobase/lock/lock0lock.c:
Auto merged
innobase/log/log0recv.c:
Auto merged
innobase/mem/mem0dbg.c:
Auto merged
innobase/mtr/mtr0mtr.c:
Auto merged
innobase/os/os0proc.c:
Auto merged
innobase/page/page0page.c:
Auto merged
innobase/que/que0que.c:
Auto merged
innobase/rem/rem0cmp.c:
Auto merged
innobase/row/row0ins.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/srv/srv0start.c:
Auto merged
innobase/sync/sync0sync.c:
Auto merged
innobase/trx/trx0rec.c:
Auto merged
innobase/trx/trx0trx.c:
Auto merged
innobase/ut/ut0mem.c:
Auto merged
innobase/ut/ut0ut.c:
Auto merged
libmysql/libmysql.c:
Auto merged
scripts/mysql_config.sh:
Auto merged
sql/net_serv.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'innobase/mem')
-rw-r--r-- | innobase/mem/mem0dbg.c | 145 |
1 files changed, 1 insertions, 144 deletions
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c index 5831dc4c451..89ca68a1232 100644 --- a/innobase/mem/mem0dbg.c +++ b/innobase/mem/mem0dbg.c @@ -603,130 +603,7 @@ mem_heap_validate( return(TRUE); } -/********************************************************************* -Prints information of dynamic memory usage and currently allocated -memory heaps or buffers. Can only be used in the debug version. */ -static -void -mem_print_info_low( -/*===============*/ - ibool print_all __attribute__((unused))) - /* in: if TRUE, all heaps are printed, - else only the heaps allocated after the - previous call of this function */ -{ #ifdef UNIV_MEM_DEBUG - mem_hash_node_t* node; - ulint n_heaps = 0; - ulint allocated_mem; - ulint ph_size; - ulint total_allocated_mem = 0; - ibool error; - ulint n_blocks; -#endif - FILE* outfile; - - /* outfile = fopen("ibdebug", "a"); */ - - outfile = stdout; - - fprintf(outfile, "\n"); - fprintf(outfile, - "________________________________________________________\n"); - fprintf(outfile, "MEMORY ALLOCATION INFORMATION\n\n"); - -#ifndef UNIV_MEM_DEBUG - - mem_pool_print_info(outfile, mem_comm_pool); - - fprintf(outfile, - "Sorry, non-debug version cannot give more memory info\n"); - - /* fclose(outfile); */ - - return; -#else - mutex_enter(&mem_hash_mutex); - - fprintf(outfile, "LIST OF CREATED HEAPS AND ALLOCATED BUFFERS: \n\n"); - - if (!print_all) { - fprintf(outfile, "AFTER THE LAST PRINT INFO\n"); - } - - node = UT_LIST_GET_FIRST(mem_all_list_base); - - while (node != NULL) { - n_heaps++; - - if (!print_all && node->nth_heap < mem_last_print_info) { - - goto next_heap; - } - - mem_heap_validate_or_print(node->heap, NULL, - FALSE, &error, &allocated_mem, - &ph_size, &n_blocks); - total_allocated_mem += allocated_mem; - - fprintf(outfile, - "%lu: file %s line %lu of size %lu phys.size %lu with %lu blocks, type %lu\n", - node->nth_heap, node->file_name, node->line, - allocated_mem, ph_size, n_blocks, - (node->heap)->type); - next_heap: - node = UT_LIST_GET_NEXT(all_list, node); - } - - fprintf(outfile, "\n"); - - fprintf(outfile, "Current allocated memory : %lu\n", - mem_current_allocated_memory); - fprintf(outfile, "Current allocated heaps and buffers : %lu\n", - n_heaps); - fprintf(outfile, "Cumulative allocated memory : %lu\n", - mem_total_allocated_memory); - fprintf(outfile, "Maximum allocated memory : %lu\n", - mem_max_allocated_memory); - fprintf(outfile, "Cumulative created heaps and buffers : %lu\n", - mem_n_created_heaps); - fprintf(outfile, "Cumulative number of allocations : %lu\n", - mem_n_allocations); - - mem_last_print_info = mem_n_created_heaps; - - mutex_exit(&mem_hash_mutex); - - mem_pool_print_info(outfile, mem_comm_pool); - -/* mem_validate(); */ - -/* fclose(outfile); */ -#endif -} - -/********************************************************************* -Prints information of dynamic memory usage and currently allocated memory -heaps or buffers. Can only be used in the debug version. */ - -void -mem_print_info(void) -/*================*/ -{ - mem_print_info_low(TRUE); -} - -/********************************************************************* -Prints information of dynamic memory usage and currently allocated memory -heaps or buffers since the last ..._print_info or..._print_new_info. */ - -void -mem_print_new_info(void) -/*====================*/ -{ - mem_print_info_low(FALSE); -} - /********************************************************************* TRUE if no memory is currently allocated. */ @@ -735,8 +612,6 @@ mem_all_freed(void) /*===============*/ /* out: TRUE if no heaps exist */ { -#ifdef UNIV_MEM_DEBUG - mem_hash_node_t* node; ulint heap_count = 0; ulint i; @@ -764,15 +639,6 @@ mem_all_freed(void) } else { return(FALSE); } - -#else - - printf( - "Sorry, non-debug version cannot check if all memory is freed.\n"); - - return(FALSE); - -#endif } /********************************************************************* @@ -783,8 +649,6 @@ mem_validate_no_assert(void) /*========================*/ /* out: TRUE if error */ { -#ifdef UNIV_MEM_DEBUG - mem_hash_node_t* node; ulint n_heaps = 0; ulint allocated_mem; @@ -843,14 +707,6 @@ mem_validate_no_assert(void) mutex_exit(&mem_hash_mutex); return(error); - -#else - - printf("Sorry, non-debug version cannot validate dynamic memory\n"); - - return(FALSE); - -#endif } /**************************************************************** @@ -865,6 +721,7 @@ mem_validate(void) return(TRUE); } +#endif /* UNIV_MEM_DEBUG */ /**************************************************************** Tries to find neigboring memory allocation blocks and dumps to stderr |