0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Deferred call may need to be returned for future cleanups

This commit is contained in:
Maria Matejka 2024-11-23 21:24:45 +01:00
parent 77dee46e98
commit 6ba06dc4df

View File

@ -34,7 +34,9 @@ struct deferred {
extern _Thread_local struct deferred local_deferred;
void defer_init(linpool *lp);
static inline void defer_call(struct deferred_call *call, size_t actual_size) {
static inline struct deferred_call *
defer_call(struct deferred_call *call, size_t actual_size)
{
/* Reallocate the call to the appropriate linpool */
ASSERT_DIE(actual_size < 128);
struct deferred_call *a = lp_alloc(local_deferred.lp, actual_size);
@ -48,6 +50,8 @@ static inline void defer_call(struct deferred_call *call, size_t actual_size) {
a->next = NULL;
*local_deferred.last = a;
local_deferred.last = &a->next;
return a;
}
#endif