Loading innobase/include/mem0mem.ic +10 −2 Original line number Diff line number Diff line Loading @@ -170,7 +170,9 @@ mem_heap_alloc( buf = (byte*)buf + MEM_FIELD_HEADER_SIZE; #endif #ifdef UNIV_SET_MEM_TO_ZERO memset(buf, '\0', n); #endif return(buf); } Loading Loading @@ -494,8 +496,14 @@ mem_alloc_func( ) { #ifndef UNIV_MEM_DEBUG void* buf; return(mem_area_alloc(n, mem_comm_pool)); buf = mem_area_alloc(n, mem_comm_pool); #ifdef UNIV_SET_MEM_TO_ZERO memset(buf, '\0', n); #endif return(buf); #else Loading innobase/include/ut0mem.h +30 −3 Original line number Diff line number Diff line Loading @@ -26,12 +26,39 @@ int ut_memcmp(void* str1, void* str2, ulint n); /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined and set_to_zero is TRUE. */ void* ut_malloc(ulint n); ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ ibool set_to_zero); /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined. */ void* ut_malloc( /*======*/ /* out, own: allocated memory */ ulint n); /* in: number of bytes to allocate */ /************************************************************************** Frees a memory bloock allocated with ut_malloc. */ void ut_free( /*====*/ void* ptr); /* in, own: memory block */ /************************************************************************** Frees all allocated memory not freed yet. */ UNIV_INLINE void ut_free(void* ptr); ut_free_all_mem(void); /*=================*/ UNIV_INLINE char* Loading innobase/include/ut0mem.ic +0 −7 Original line number Diff line number Diff line Loading @@ -27,13 +27,6 @@ ut_memcmp(void* str1, void* str2, ulint n) return(memcmp(str1, str2, n)); } UNIV_INLINE void ut_free(void* ptr) { free(ptr); } UNIV_INLINE char* ut_strcpy(char* dest, char* sour) Loading innobase/mem/mem0pool.c +5 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,11 @@ mem_pool_create( pool = ut_malloc(sizeof(mem_pool_t)); pool->buf = ut_malloc(size); /* We do not set the memory to zero (FALSE) in the pool, but only when allocated at a higher level in mem0mem.c. This is to avoid masking useful Purify warnings. */ pool->buf = ut_malloc_low(size, FALSE); pool->size = size; mutex_create(&(pool->mutex)); Loading innobase/srv/srv0start.c +2 −0 Original line number Diff line number Diff line Loading @@ -916,5 +916,7 @@ innobase_shutdown_for_mysql(void) logs_empty_and_mark_files_at_shutdown(); ut_free_all_mem(); return((int) DB_SUCCESS); } Loading
innobase/include/mem0mem.ic +10 −2 Original line number Diff line number Diff line Loading @@ -170,7 +170,9 @@ mem_heap_alloc( buf = (byte*)buf + MEM_FIELD_HEADER_SIZE; #endif #ifdef UNIV_SET_MEM_TO_ZERO memset(buf, '\0', n); #endif return(buf); } Loading Loading @@ -494,8 +496,14 @@ mem_alloc_func( ) { #ifndef UNIV_MEM_DEBUG void* buf; return(mem_area_alloc(n, mem_comm_pool)); buf = mem_area_alloc(n, mem_comm_pool); #ifdef UNIV_SET_MEM_TO_ZERO memset(buf, '\0', n); #endif return(buf); #else Loading
innobase/include/ut0mem.h +30 −3 Original line number Diff line number Diff line Loading @@ -26,12 +26,39 @@ int ut_memcmp(void* str1, void* str2, ulint n); /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined and set_to_zero is TRUE. */ void* ut_malloc(ulint n); ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ ibool set_to_zero); /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined. */ void* ut_malloc( /*======*/ /* out, own: allocated memory */ ulint n); /* in: number of bytes to allocate */ /************************************************************************** Frees a memory bloock allocated with ut_malloc. */ void ut_free( /*====*/ void* ptr); /* in, own: memory block */ /************************************************************************** Frees all allocated memory not freed yet. */ UNIV_INLINE void ut_free(void* ptr); ut_free_all_mem(void); /*=================*/ UNIV_INLINE char* Loading
innobase/include/ut0mem.ic +0 −7 Original line number Diff line number Diff line Loading @@ -27,13 +27,6 @@ ut_memcmp(void* str1, void* str2, ulint n) return(memcmp(str1, str2, n)); } UNIV_INLINE void ut_free(void* ptr) { free(ptr); } UNIV_INLINE char* ut_strcpy(char* dest, char* sour) Loading
innobase/mem/mem0pool.c +5 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,11 @@ mem_pool_create( pool = ut_malloc(sizeof(mem_pool_t)); pool->buf = ut_malloc(size); /* We do not set the memory to zero (FALSE) in the pool, but only when allocated at a higher level in mem0mem.c. This is to avoid masking useful Purify warnings. */ pool->buf = ut_malloc_low(size, FALSE); pool->size = size; mutex_create(&(pool->mutex)); Loading
innobase/srv/srv0start.c +2 −0 Original line number Diff line number Diff line Loading @@ -916,5 +916,7 @@ innobase_shutdown_for_mysql(void) logs_empty_and_mark_files_at_shutdown(); ut_free_all_mem(); return((int) DB_SUCCESS); }