summaryrefslogtreecommitdiff
path: root/mysys/tree.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-08-11 22:44:43 +0300
committermonty@mashka.mysql.fi <>2003-08-11 22:44:43 +0300
commit2263e3e51faba531a0a7055dbf706a6a8719ad70 (patch)
tree3c0ddcb446b8be099c3ab2616c459a573ee3cf92 /mysys/tree.c
parent1279f9b024614cf97cf447cfb10d6d7d69abb8bc (diff)
parent6e7a509d06824447e427dd44d5692489267d9c4b (diff)
downloadmariadb-git-2263e3e51faba531a0a7055dbf706a6a8719ad70.tar.gz
Merge with 4.0.14
Diffstat (limited to 'mysys/tree.c')
-rw-r--r--mysys/tree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mysys/tree.c b/mysys/tree.c
index 91d2f9771b5..42c58131100 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -109,6 +109,11 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
if (!free_element && size >= 0 &&
((uint) size <= sizeof(void*) || ((uint) size & (sizeof(void*)-1))))
{
+ /*
+ We know that the data doesn't have to be aligned (like if the key
+ contains a double), so we can store the data combined with the
+ TREE_ELEMENT.
+ */
tree->offset_to_key=sizeof(TREE_ELEMENT); /* Put key after element */
/* Fix allocation size so that we don't lose any memory */
default_alloc_size/=(sizeof(TREE_ELEMENT)+size);