1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

10.0-base merge (roles)

This commit is contained in:
Sergei Golubchik
2013-10-29 15:08:44 +01:00
248 changed files with 10725 additions and 1899 deletions

View File

@@ -321,7 +321,24 @@ void delete_dynamic_element(DYNAMIC_ARRAY *array, uint idx)
(array->elements-idx)*array->size_of_element);
}
/*
Wrapper around delete_dynamic, calling a FREE function on every
element, before releasing the memory
SYNOPSIS
delete_dynamic_with_callback()
array
f The function to be called on every element before
deleting the array;
*/
void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f) {
uint i;
char *ptr= (char*) array->buffer;
for (i= 0; i < array->elements; i++, ptr+= array->size_of_element) {
f(ptr);
}
delete_dynamic(array);
}
/*
Free unused memory