MCPcopy Create free account
hub / github.com/MariaDB/server / delete_dynamic_with_callback

Function delete_dynamic_with_callback

mysys/array.c:378–385  ·  view source on GitHub ↗

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; */

Source from the content-addressed store, hash-verified

376 deleting the array;
377*/
378void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f) {
379 size_t i;
380 char *ptr= (char*) array->buffer;
381 for (i= 0; i < array->elements; i++, ptr+= array->size_of_element) {
382 f(ptr);
383 }
384 delete_dynamic(array);
385}
386/*
387 Free unused memory
388

Callers 3

acl_freeFunction · 0.85
acl_reloadFunction · 0.85

Calls 1

delete_dynamicFunction · 0.85

Tested by

no test coverage detected