diff options
Diffstat (limited to 'myisam/rt_split.c')
-rw-r--r-- | myisam/rt_split.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/myisam/rt_split.c b/myisam/rt_split.c index 62b8ea6a65b..005e86805bb 100644 --- a/myisam/rt_split.c +++ b/myisam/rt_split.c @@ -17,6 +17,8 @@ #include "myisamdef.h" +#ifdef HAVE_RTREE_KEYS + #include "rt_index.h" #include "rt_key.h" #include "rt_mbr.h" @@ -265,12 +267,12 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, n_dim = keyinfo->keysegs / 2; - if (!my_multi_malloc(MYF(0), - &coord_buf, n_dim * 2 * sizeof(double) * (max_keys + 1 + 4), - &task, sizeof(SplitStruct) * (max_keys + 1), - NullS)) + if (!(coord_buf= my_alloca(n_dim * 2 * sizeof(double) * (max_keys + 1 + 4) + + sizeof(SplitStruct) * (max_keys + 1)))) return -1; + task= (SplitStruct *)(coord_buf + n_dim * 2 * (max_keys + 1 + 4)); + next_coord = coord_buf; stop = task + max_keys; @@ -343,6 +345,8 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, my_afree((byte*)new_page); split_err: - my_free((gptr) coord_buf, MYF(0)); + my_afree((byte*) coord_buf); return err_code; } + +#endif /*HAVE_RTREE_KEYS*/ |