From f43dce346825f632b02527f2a774de36718635d7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 20 Oct 2010 16:03:13 +0100 Subject: [PATCH] lib-storage: mailbox_get_status(): return cache fields allocated from data stack. Allocating them from mailbox's pool just wastes memory if it's called multiple times for same mailbox. --- src/lib-storage/index/index-status.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib-storage/index/index-status.c b/src/lib-storage/index/index-status.c index 56a9824090..9ad25ff8bb 100644 --- a/src/lib-storage/index/index-status.c +++ b/src/lib-storage/index/index-status.c @@ -19,10 +19,8 @@ index_storage_get_status_cache_fields(struct mailbox *box, fields = mail_cache_register_get_list(box->cache, pool_datastack_create(), &count); - /* a bit leaky to allocate memory from mailbox pool every time, but this - is unlikely to be called more than once for the mailbox anyway. */ - cache_fields = p_new(box->pool, ARRAY_TYPE(const_string), 1); - p_array_init(cache_fields, box->pool, count); + cache_fields = t_new(ARRAY_TYPE(const_string), 1); + t_array_init(cache_fields, count); for (i = 0; i < count; i++) { dec = fields[i].decision & ~MAIL_CACHE_DECISION_FORCED; if (dec != MAIL_CACHE_DECISION_NO) -- 2.47.3