diff options
author | monty@mashka.mysql.fi <> | 2002-11-21 15:56:48 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-11-21 15:56:48 +0200 |
commit | dac6498f9b5b28d94473baf46c6e6f174943728d (patch) | |
tree | d3df5d3fc1abf364dcbcc8eb2305a1cf62540192 /mysys/tree.c | |
parent | 305d16a7cb3955c20ab5d119b3eb0968008683b6 (diff) | |
parent | e60050c4dd652c7a431aebeb95b7dd944be87bf8 (diff) | |
download | mariadb-git-dac6498f9b5b28d94473baf46c6e6f174943728d.tar.gz |
Merge with 4.0
Diffstat (limited to 'mysys/tree.c')
-rw-r--r-- | mysys/tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mysys/tree.c b/mysys/tree.c index 3e20820ebd9..364b6992108 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -53,7 +53,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 *, @@ -80,8 +81,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; |