diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-12-06 15:08:42 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-12-06 15:08:42 +0100 |
commit | 6491c591b26b61a99fd4279d65b93d277083c4c7 (patch) | |
tree | 9a51f59c7bc9b95c04ab6446d012959cb50a1f3d /sql/sql_array.h | |
parent | 328d7779bc1e5b88b7f72dde8465d0c58f38f42c (diff) | |
parent | daca7e70d70cfc59b4139239bbd09b7c63912be9 (diff) | |
download | mariadb-git-6491c591b26b61a99fd4279d65b93d277083c4c7.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/sql_array.h')
-rw-r--r-- | sql/sql_array.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/sql_array.h b/sql/sql_array.h index 159951e26a6..3e75a9ea546 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -114,8 +114,7 @@ public: void init(uint prealloc=16, uint increment=16) { - my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment, - MYF(0)); + init_dynamic_array2(&array, sizeof(Elem), 0, prealloc, increment, MYF(0)); } /** @@ -208,6 +207,11 @@ public: set_dynamic(&array, &el, idx); } + void freeze() + { + freeze_size(&array); + } + bool resize(size_t new_size, Elem default_val) { size_t old_size= elements(); @@ -230,6 +234,11 @@ public: delete_dynamic(&array); } + void free_memory() + { + delete_dynamic(&array); + } + typedef int (*CMP_FUNC)(const Elem *el1, const Elem *el2); void sort(CMP_FUNC cmp_func) @@ -237,7 +246,7 @@ public: my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func); } - typedef int (*CMP_FUNC2)(const Elem *el1, const Elem *el2, void *); + typedef int (*CMP_FUNC2)(void *, const Elem *el1, const Elem *el2); void sort(CMP_FUNC2 cmp_func, void *data) { my_qsort2(array.buffer, array.elements, sizeof(Elem), (qsort2_cmp)cmp_func, data); |