diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-07 16:32:32 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-12-07 16:32:32 +0200 |
commit | 201680126a4754357c8d6180c77a256b78e79868 (patch) | |
tree | 6eb308f567a554fad94c5e544ef4090f6c1b5096 /sql/sql_array.h | |
parent | b6639a3cffa0923c6deb7e1d0f814196fa8e8aab (diff) | |
parent | ce8716a1ed786ff971b5e15c88385d50b649ec7f (diff) | |
download | mariadb-git-bb-10.4-MDEV-17520.tar.gz |
Merge 10.4 into HEADbb-10.4-MDEV-17520
Diffstat (limited to 'sql/sql_array.h')
-rw-r--r-- | sql/sql_array.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_array.h b/sql/sql_array.h index 0e5246b7e2a..0f18a89360a 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -123,8 +123,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)); } /** @@ -218,6 +217,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(); @@ -252,7 +256,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); |