* - NULL on error.
*/
#define fr_heap_talloc_create(_cmp, _talloc_type, _field) \
- _fr_heap_create(_cmp, #_talloc_type, (size_t)offsetof(_talloc_type), _field))
+ _fr_heap_create(_cmp, #_talloc_type, (size_t)offsetof(_talloc_type, _field))
fr_heap_t *_fr_heap_create(fr_heap_cmp_t cmp, char const *talloc_type, size_t offset);
WORKER_HEAP_INIT(to_decode, worker_message_cmp, fr_channel_data_t, channel.heap_id);
WORKER_HEAP_INIT(localized, worker_message_cmp, fr_channel_data_t, channel.heap_id);
- worker->runnable = fr_heap_create(worker_runnable_cmp, REQUEST, runnable_id);
+ worker->runnable = fr_heap_talloc_create(worker_runnable_cmp, REQUEST, runnable_id);
if (!worker->runnable) {
fr_strerror_printf("Failed creating runnable heap");
goto fail;
}
- worker->time_order = fr_heap_create(worker_time_order_cmp, REQUEST, time_order_id);
+ worker->time_order = fr_heap_talloc_create(worker_time_order_cmp, REQUEST, time_order_id);
if (!worker->time_order) {
fr_strerror_printf("Failed creating time_order heap");
goto fail;
el->kq = -1; /* So destructor can be used before kqueue() provides us with fd */
talloc_set_destructor(el, _event_list_free);
- el->times = fr_heap_create(fr_event_timer_cmp, fr_event_timer_t, heap_id);
+ el->times = fr_heap_talloc_create(fr_event_timer_cmp, fr_event_timer_t, heap_id);
if (!el->times) {
fr_strerror_printf("Failed allocating event heap");
error:
{
int32_t child = hp->num_elements;
+#ifndef TALLOC_GET_TYPE_ABORT_NOOP
+ if (hp->type) (void)_talloc_get_type_abort(data, hp->type, __location__);
+#endif
+
/*
* Heap is full. Double it's size.
*/
* https://code.facebook.com/posts/1499322996995183/solving-the-mystery-of-link-imbalance-a-metastable-failure-state-at-scale/
*/
if (!pool->spread) {
- pool->heap = fr_heap_create(last_reserved_cmp, fr_pool_connection_t, heap_id);
+ pool->heap = fr_heap_talloc_create(last_reserved_cmp, fr_pool_connection_t, heap_id);
/*
* For some types of connections we need to used a different
* algorithm, because load balancing benefits are secondary
* That way we maximise time between connection use.
*/
} else {
- pool->heap = fr_heap_create(last_released_cmp, fr_pool_connection_t, heap_id);
+ pool->heap = fr_heap_talloc_create(last_released_cmp, fr_pool_connection_t, heap_id);
}
if (!pool->heap) {
ERROR("%s: Failed creating connection heap", __FUNCTION__);
return RLM_MODULE_FAIL;
}
- MEM(backlog = fr_heap_create(_unlang_request_ptr_cmp, REQUEST, runnable_id));
+ MEM(backlog = fr_heap_talloc_create(_unlang_request_ptr_cmp, REQUEST, runnable_id));
old_el = request->el;
old_backlog = request->backlog;
caller = request->module;
/*
* The heap of entries to expire.
*/
- driver->heap = fr_heap_create(cache_heap_cmp, rlm_cache_rbtree_entry_t, heap_id);
+ driver->heap = fr_heap_talloc_create(cache_heap_cmp, rlm_cache_rbtree_entry_t, heap_id);
if (!driver->heap) {
ERROR("Failed to create heap for the cache");
return -1;
t->inst = instance;
t->el = el;
- t->queued = fr_heap_create(queue_cmp, rlm_radius_udp_request_t, heap_id);
+ t->queued = fr_heap_talloc_create(queue_cmp, rlm_radius_udp_request_t, heap_id);
FR_DLIST_INIT(t->blocked);
FR_DLIST_INIT(t->full);
FR_DLIST_INIT(t->zombie);
FR_DLIST_INIT(t->opening);
- t->active = fr_heap_create(conn_cmp, rlm_radius_udp_connection_t, heap_id);
+ t->active = fr_heap_talloc_create(conn_cmp, rlm_radius_udp_connection_t, heap_id);
conn_alloc(t->inst, t);