summaryrefslogtreecommitdiff
path: root/innobase/mem/mem0pool.c
diff options
context:
space:
mode:
authorheikki@donna.mysql.fi <>2002-02-04 23:55:41 +0200
committerheikki@donna.mysql.fi <>2002-02-04 23:55:41 +0200
commitaea3c07139ca98294ee847f11310963e9c16f861 (patch)
tree8afb00e0a5c01501d06fda6b055c26e219075b91 /innobase/mem/mem0pool.c
parent9c86441ef63023be60427f57184d466468994f73 (diff)
downloadmariadb-git-aea3c07139ca98294ee847f11310963e9c16f861.tar.gz
Many files:
Small improvements row0mysql.c: Small improvements + fix the ALTER TABLE problem by introducing a lazy drop table it can use ha_innobase.cc: Some fine-tuning of optimization
Diffstat (limited to 'innobase/mem/mem0pool.c')
-rw-r--r--innobase/mem/mem0pool.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 48e7e686953..3681c8ef779 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -78,9 +78,9 @@ pool, and after that its locks will grow into the buffer pool. */
/* The smallest memory area total size */
#define MEM_AREA_MIN_SIZE (2 * MEM_AREA_EXTRA_SIZE)
+
/* Data structure for a memory pool. The space is allocated using the buddy
algorithm, where free list i contains areas of size 2 to power i. */
-
struct mem_pool_struct{
byte* buf; /* memory pool */
ulint size; /* memory common pool size */
@@ -99,6 +99,26 @@ mem_pool_t* mem_comm_pool = NULL;
ulint mem_out_of_mem_err_msg_count = 0;
/************************************************************************
+Reserves the mem pool mutex. */
+
+void
+mem_pool_mutex_enter(void)
+/*======================*/
+{
+ mutex_enter(&(mem_comm_pool->mutex));
+}
+
+/************************************************************************
+Releases the mem pool mutex. */
+
+void
+mem_pool_mutex_exit(void)
+/*=====================*/
+{
+ mutex_exit(&(mem_comm_pool->mutex));
+}
+
+/************************************************************************
Returns memory area size. */
UNIV_INLINE
ulint
@@ -240,15 +260,15 @@ mem_pool_fill_free_list(
if (mem_out_of_mem_err_msg_count % 1000000000 == 0) {
/* We do not print the message every time: */
+
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "Innobase: Warning: out of memory in additional memory pool.\n");
- fprintf(stderr,
- "Innobase: Innobase will start allocating memory from the OS.\n");
- fprintf(stderr,
- "Innobase: You should restart the database with a bigger value in\n");
- fprintf(stderr,
- "Innobase: the MySQL .cnf file for innobase_additional_mem_pool_size.\n");
+ " InnoDB: Out of memory in additional memory pool.\n"
+ "InnoDB: InnoDB will start allocating memory from the OS.\n"
+ "InnoDB: You may get better performance if you configure a bigger\n"
+ "InnoDB: value in the MySQL my.cnf file for\n"
+ "InnoDB: innodb_additional_mem_pool_size.\n");
}
mem_out_of_mem_err_msg_count++;