From f74d4280174e3bfb1a0dc27eb6b99f7af3fc3874 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 10 Sep 2026 12:45:14 -0400 Subject: [PATCH] MT#55283 use lightweight alloc for slices Change-Id: I63b0a7a96675a53905071931f3bab1fa89fd5d8d --- daemon/call.c | 6 ++++++ lib/helpers.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 9e3e19afa..6b7311a41 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -5443,6 +5443,8 @@ void call_media_free(struct call_media *md) { memory_arena_free_lw(md->media_id.s); memory_arena_free_lw(md->label.s); memory_arena_free_lw(md->tls_id.s); + + memory_arena_free_lw(md); } void __monologue_free(struct call_monologue *m) { @@ -5455,6 +5457,8 @@ void __monologue_free(struct call_monologue *m) { t_queue_clear_full(&m->all_attributes, sdp_attr_free); t_queue_clear(&m->tag_aliases); t_queue_clear(&m->groups_other); + + memory_arena_free_lw(m); } static void __call_free(call_t *c) { @@ -5484,6 +5488,7 @@ static void __call_free(call_t *c) { while (c->endpoint_maps.head) { em = i_queue_pop_head(&c->endpoint_maps); t_queue_clear_full(&em->intf_sfds, free_sfd_intf_list); + memory_arena_free_lw(em); } t_hash_table_destroy(c->tags); @@ -5500,6 +5505,7 @@ static void __call_free(call_t *c) { t_hash_table_destroy(ps->rtp_stats); bufferpool_unref(ps->stats_in); bufferpool_unref(ps->stats_out); + memory_arena_free_lw(ps); } memory_arena = NULL; diff --git a/lib/helpers.h b/lib/helpers.h index ecf828b18..538569cbc 100644 --- a/lib/helpers.h +++ b/lib/helpers.h @@ -258,14 +258,14 @@ void thread_create_looper(enum thread_looper_action (*f)(void), const char *sche /*** ALLOC WITH UNIQUE ID HELPERS ***/ #define uid_alloc(q) ({ \ - __typeof__((q)->__t) __ret = memory_arena_alloc0(__typeof__(*(q)->__t)); \ + __typeof__((q)->__t) __ret = memory_arena_alloc0_lw(__typeof__(*(q)->__t)); \ __ret->unique_id = (q)->length; \ t_queue_push_tail(q, __ret); \ __ret; \ }) #define iuid_alloc(q) ({ \ - __typeof__((q)->head) __ret = memory_arena_alloc0(__typeof__(*(q)->head)); \ + __typeof__((q)->head) __ret = memory_arena_alloc0_lw(__typeof__(*(q)->head)); \ __ret->unique_id = (q)->length; \ i_queue_push_tail(q, __ret); \ __ret; \