* @param[in] func Function to attach. \
* @param[in] uctx to be passed to func. \
*/ \
- static inline CC_HINT(nonnull(1,2)) void fr_ ## _type ## _slab_set_destructor(_type *elem, fr_ ## _type ## _slab_free_t func, void *uctx) \
+ static inline CC_HINT(nonnull(1,2)) void fr_ ## _name ## _slab_element_set_destructor(_type *elem, fr_ ## _type ## _slab_free_t func, void *uctx) \
{ \
fr_ ## _name ## _slab_element_t *element = (fr_ ## _name ## _slab_element_t *)elem; \
element->free = func; \
/* "if" to keep clang scan happy */
if (test_elements[0]) test_elements[0]->name = talloc_strdup(test_elements[0], "Hello there");
- if (test_elements[0]) fr_test_element_t_slab_set_destructor(test_elements[0], test_element_free, &test_uctx);
+ if (test_elements[0]) fr_test_slab_element_set_destructor(test_elements[0], test_element_free, &test_uctx);
test_elements[1] = fr_test_slab_reserve(test_slab_list);
TEST_CHECK(test_elements[1] != NULL);
test_elements[2] = fr_test_slab_reserve(test_slab_list);
TEST_CHECK(test_elements[2] != NULL);
if (test_elements[2]) test_elements[2]->name = talloc_strdup(test_elements[2], "Hello there testing");
- if (test_elements[2]) fr_test_element_t_slab_set_destructor(test_elements[2], test_element_free, &test_uctx2);
+ if (test_elements[2]) fr_test_slab_element_set_destructor(test_elements[2], test_element_free, &test_uctx2);
TEST_CHECK_RET(fr_test_slab_num_allocated(test_slab_list), 2);
TEST_CHECK_RET(fr_test_slab_num_elements_used(test_slab_list), 3);
test_uctx.count = 0;
if (test_elements[0]) test_elements[0]->name = talloc_strdup(test_elements[0], "Hello there");
- if (test_elements[0]) fr_test_element_t_slab_set_destructor(test_elements[0], test_element_free, &test_uctx);
+ if (test_elements[0]) fr_test_slab_element_set_destructor(test_elements[0], test_element_free, &test_uctx);
test_elements[1] = fr_test_slab_reserve(test_slab_list);
TEST_CHECK(test_elements[1] != NULL);
test_uctx.count = 0;
if (test_elements[0]) test_elements[0]->name = talloc_strdup(test_elements[0], "Hello there");
- if (test_elements[0]) fr_test_element_t_slab_set_destructor(test_elements[0], test_element_free, &test_uctx);
+ if (test_elements[0]) fr_test_slab_element_set_destructor(test_elements[0], test_element_free, &test_uctx);
test_elements[1] = fr_test_slab_reserve(test_slab_list);
TEST_CHECK(test_elements[1] != NULL);
test_uctx.count = 0;
if (test_element) test_element->name = talloc_strdup(test_element, "Hello there");
- if (test_element) fr_test_element_t_slab_set_destructor(test_element, test_element_free, &test_uctx);
+ if (test_element) fr_test_slab_element_set_destructor(test_element, test_element_free, &test_uctx);
if (test_element) talloc_free(test_element);
TEST_CHECK(test_uctx.count == 11);