summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-09-20 21:04:48 +0300
committerunknown <heikki@donna.mysql.fi>2001-09-20 21:04:48 +0300
commit31fd0c63e04c416af61036d2e1f4e5e6f9ea877d (patch)
tree93ddcb5cf7eb5dcc4666dd6f0700e66f31fff260 /innobase/include
parentc66208cfbf2726a2c9fe6eed9f4d71e2fff5dfbd (diff)
downloadmariadb-git-31fd0c63e04c416af61036d2e1f4e5e6f9ea877d.tar.gz
mem0mem.ic Changes to eliminate unnecessary Purify warnings
ut0mem.h Changes to eliminate unnecessary Purify warnings ut0mem.ic Changes to eliminate unnecessary Purify warnings srv0start.c Changes to eliminate unnecessary Purify warnings mem0pool.c Changes to eliminate unnecessary Purify warnings ut0mem.c Changes to eliminate unnecessary Purify warnings innobase/ut/ut0mem.c: Changes to eliminate unnecessary Purify warnings innobase/mem/mem0pool.c: Changes to eliminate unnecessary Purify warnings innobase/srv/srv0start.c: Changes to eliminate unnecessary Purify warnings innobase/include/ut0mem.h: Changes to eliminate unnecessary Purify warnings innobase/include/ut0mem.ic: Changes to eliminate unnecessary Purify warnings innobase/include/mem0mem.ic: Changes to eliminate unnecessary Purify warnings
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/mem0mem.ic12
-rw-r--r--innobase/include/ut0mem.h33
-rw-r--r--innobase/include/ut0mem.ic7
3 files changed, 40 insertions, 12 deletions
diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
index 8b8449469ef..edc3ab17f2a 100644
--- a/innobase/include/mem0mem.ic
+++ b/innobase/include/mem0mem.ic
@@ -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);
}
@@ -494,8 +496,14 @@ mem_alloc_func(
)
{
#ifndef UNIV_MEM_DEBUG
+ void* buf;
+
+ buf = mem_area_alloc(n, mem_comm_pool);
- return(mem_area_alloc(n, mem_comm_pool));
+#ifdef UNIV_SET_MEM_TO_ZERO
+ memset(buf, '\0', n);
+#endif
+ return(buf);
#else
diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
index fa46514fe16..8e5a4fda0d3 100644
--- a/innobase/include/ut0mem.h
+++ b/innobase/include/ut0mem.h
@@ -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*
diff --git a/innobase/include/ut0mem.ic b/innobase/include/ut0mem.ic
index fc4b6bd8be5..7ae9bc8bd74 100644
--- a/innobase/include/ut0mem.ic
+++ b/innobase/include/ut0mem.ic
@@ -28,13 +28,6 @@ ut_memcmp(void* str1, void* str2, ulint n)
}
UNIV_INLINE
-void
-ut_free(void* ptr)
-{
- free(ptr);
-}
-
-UNIV_INLINE
char*
ut_strcpy(char* dest, char* sour)
{