[evolution-patches] EMemChunk replacement in CamelException



A tracker bug for these replacements is here:

http://bugzilla.gnome.org/show_bug.cgi?id=363156

A ChangeLog will be appended to the combined patch once most/all
replacements are finished.

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be
gnome: pvanhoof at gnome dot org
work: vanhoof at x-tend dot be
blog: http://pvanhoof.be/blog
--- /home/pvanhoof/repos/gnome/cvs/evolution-data-server/camel/camel-exception.c	2006-04-12 21:14:13.000000000 +0200
+++ camel-exception.c	2006-10-19 16:10:27.000000000 +0200
@@ -47,8 +47,6 @@
 #define CAMEL_EXCEPTION_LOCK(e) (pthread_mutex_lock(&exception_mutex))
 #define CAMEL_EXCEPTION_UNLOCK(e) (pthread_mutex_unlock(&exception_mutex))
 
-static EMemChunk *exception_chunks = NULL;
-
 /**
  * camel_exception_new: allocate a new exception object. 
  * 
@@ -63,10 +61,7 @@
 
 	CAMEL_EXCEPTION_LOCK(exception);
 
-	if (exception_chunks == NULL)
-		exception_chunks = e_memchunk_new(16, sizeof(CamelException));
-
-	ex = e_memchunk_alloc(exception_chunks);
+	ex = g_slice_new (CamelException);
 	ex->desc = NULL;
 
 	/* set the Exception Id to NULL */
@@ -135,9 +130,7 @@
 		g_free (exception->desc);
 
 	CAMEL_EXCEPTION_LOCK(exception);
-
-	e_memchunk_free(exception_chunks, exception);
-
+	g_slice_free (CamelException, exception);
 	CAMEL_EXCEPTION_UNLOCK(exception);
 }
 


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