Commit c3b659a5 authored by marko's avatar marko

mem0dbg.c: Enclose some more function definitions in #ifdef UNIV_MEM_DEBUG.

The declarations were already enclosed in #ifdef UNIV_MEM_DEBUG.
parent 8768878c
...@@ -66,7 +66,6 @@ mem_hash_get_nth_cell(ulint i) ...@@ -66,7 +66,6 @@ mem_hash_get_nth_cell(ulint i)
return(&(mem_hash_table[i])); return(&(mem_hash_table[i]));
} }
#endif /* UNIV_MEM_DEBUG */
/* Accessor functions for a memory field in the debug version */ /* Accessor functions for a memory field in the debug version */
...@@ -106,6 +105,7 @@ mem_field_trailer_get_check(byte* field) ...@@ -106,6 +105,7 @@ mem_field_trailer_get_check(byte* field)
return(mach_read_from_4(field return(mach_read_from_4(field
+ mem_field_header_get_len(field))); + mem_field_header_get_len(field)));
} }
#endif /* UNIV_MEM_DEBUG */
/********************************************************************** /**********************************************************************
Initializes the memory system. */ Initializes the memory system. */
...@@ -136,6 +136,7 @@ mem_init( ...@@ -136,6 +136,7 @@ mem_init(
mem_comm_pool = mem_pool_create(size); mem_comm_pool = mem_pool_create(size);
} }
#ifdef UNIV_MEM_DEBUG
/********************************************************************** /**********************************************************************
Initializes an allocated memory field in the debug version. */ Initializes an allocated memory field in the debug version. */
...@@ -163,7 +164,6 @@ mem_field_init( ...@@ -163,7 +164,6 @@ mem_field_init(
mem_field_header_set_check(usr_buf, rnd); mem_field_header_set_check(usr_buf, rnd);
mem_field_trailer_set_check(usr_buf, rnd); mem_field_trailer_set_check(usr_buf, rnd);
#ifdef UNIV_MEM_DEBUG
/* Update the memory allocation information */ /* Update the memory allocation information */
mutex_enter(&mem_hash_mutex); mutex_enter(&mem_hash_mutex);
...@@ -182,7 +182,6 @@ mem_field_init( ...@@ -182,7 +182,6 @@ mem_field_init(
combination of 0xBA and 0xBE */ combination of 0xBA and 0xBE */
mem_init_buf(usr_buf, n); mem_init_buf(usr_buf, n);
#endif /* UNIV_MEM_DEBUG */
} }
/********************************************************************** /**********************************************************************
...@@ -199,7 +198,6 @@ mem_field_erase( ...@@ -199,7 +198,6 @@ mem_field_erase(
usr_buf = buf + MEM_FIELD_HEADER_SIZE; usr_buf = buf + MEM_FIELD_HEADER_SIZE;
#ifdef UNIV_MEM_DEBUG
mutex_enter(&mem_hash_mutex); mutex_enter(&mem_hash_mutex);
mem_current_allocated_memory -= n; mem_current_allocated_memory -= n;
mutex_exit(&mem_hash_mutex); mutex_exit(&mem_hash_mutex);
...@@ -211,10 +209,8 @@ mem_field_erase( ...@@ -211,10 +209,8 @@ mem_field_erase(
combination of 0xDE and 0xAD */ combination of 0xDE and 0xAD */
mem_erase_buf(buf, MEM_SPACE_NEEDED(n)); mem_erase_buf(buf, MEM_SPACE_NEEDED(n));
#endif /* UNIV_MEM_DEBUG */
} }
#ifdef UNIV_MEM_DEBUG
/******************************************************************* /*******************************************************************
Initializes a buffer to a random combination of hex BA and BE. Initializes a buffer to a random combination of hex BA and BE.
Used to initialize allocated memory. */ Used to initialize allocated memory. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment