[evolution-data-server] CamelIMAPXCommand: Allocate with g_slice_new().



commit 2bc0624c7330b4c0c6d699df04bcd23d8e91a1ab
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Dec 1 21:49:29 2011 -0600

    CamelIMAPXCommand: Allocate with g_slice_new().
    
    Slab allocator is more efficient for fixed-size structs.

 camel/providers/imapx/camel-imapx-server.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 724785b..9173d6c 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -772,7 +772,7 @@ camel_imapx_command_new (CamelIMAPXServer *is,
 	if (cancellable != NULL)
 		g_object_ref (cancellable);
 
-	ic = g_malloc0 (sizeof (*ic));
+	ic = g_slice_new0 (CamelIMAPXCommand);
 	ic->tag = tag++;
 	ic->name = name;
 	ic->mem = (CamelStreamMem *) camel_stream_mem_new ();
@@ -840,7 +840,7 @@ camel_imapx_command_free (CamelIMAPXCommand *ic)
 	 * propagated to the CamelIMAPXJob, so it's either NULL or the
 	 * CamelIMAPXJob owns it now. */
 
-	g_free (ic);
+	g_slice_free (CamelIMAPXCommand, ic);
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]