From 8a37ce07672df44d06c0ea7b66e0c3136b1e6ab0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 6 Dec 2018 00:48:00 +0100 Subject: cleanup: DYNAMIC_ARRAY -> Dynamic_array acl_dbs --- sql/sql_array.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sql/sql_array.h') diff --git a/sql/sql_array.h b/sql/sql_array.h index 8202e94ce41..37e86008ef0 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -107,8 +107,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)); } /** @@ -201,6 +200,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(); @@ -223,6 +227,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) -- cgit v1.2.1 From eed0013bedcf13b2f95acfa793626e758dd0489b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 6 Dec 2018 00:48:41 +0100 Subject: correct order of arguments for Dynamic_array<>::CMP_FUNC2 --- sql/sql_array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_array.h') diff --git a/sql/sql_array.h b/sql/sql_array.h index 37e86008ef0..c18bec1df52 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -239,7 +239,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); -- cgit v1.2.1