summaryrefslogtreecommitdiff
path: root/mysys/tree.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-11-20 22:56:57 +0200
committermonty@mashka.mysql.fi <>2002-11-20 22:56:57 +0200
commite65ddf3fc36e086c3209835584bb71a5abc73247 (patch)
tree1deb846a75b9e1e5c1491e20df66b4d74fc6fa0b /mysys/tree.c
parentf9e6ae6f42bb4321639ec40c622c394d79d17661 (diff)
downloadmariadb-git-e65ddf3fc36e086c3209835584bb71a5abc73247.tar.gz
Try to optimize the cache buffer size needed for bulk_insert
Fix for shutdown on Mac OS X
Diffstat (limited to 'mysys/tree.c')
-rw-r--r--mysys/tree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mysys/tree.c b/mysys/tree.c
index 2ac2c88fd66..ea5cf79f084 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -45,7 +45,8 @@
#define BLACK 1
#define RED 0
-#define DEFAULT_ALLOC_SIZE (8192-MALLOC_OVERHEAD)
+#define DEFAULT_ALLOC_SIZE 8192
+#define DEFAULT_ALIGN_SIZE 8192
static void delete_tree_element(TREE *,TREE_ELEMENT *);
static int tree_walk_left_root_right(TREE *,TREE_ELEMENT *,
@@ -72,8 +73,9 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
DBUG_ENTER("init_tree");
DBUG_PRINT("enter",("tree: %lx size: %d",tree,size));
- if (!default_alloc_size)
- default_alloc_size= DEFAULT_ALLOC_SIZE;
+ if (default_alloc_size < DEFAULT_ALLOC_SIZE)
+ default_alloc_size= DEFAULT_ALLOC_SIZE;
+ default_alloc_size= MY_ALIGN(default_alloc_size, DEFAULT_ALIGN_SIZE);
bzero((gptr) &tree->null_element,sizeof(tree->null_element));
tree->root= &tree->null_element;
tree->compare=compare;