Index: camel/camel-folder-search.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder-search.c,v
retrieving revision 1.78
diff -u -p -r1.78 camel-folder-search.c
--- camel/camel-folder-search.c	9 Jun 2006 01:21:50 -0000	1.78
+++ camel/camel-folder-search.c	26 Oct 2006 03:01:38 -0000
@@ -52,7 +52,7 @@
 #define r(x) 
 
 struct _CamelFolderSearchPrivate {
-	GHashTable *mempool_hash;
+	GHashTable *string_chunk_hash;
 	CamelException *ex;
 
 	CamelFolderThread *threads;
@@ -122,23 +122,23 @@ camel_folder_search_init (CamelFolderSea
 
 	obj->sexp = e_sexp_new();
 
-	/* use a hash of mempools to associate the returned uid lists with
-	   the backing mempool.  yes pretty weird, but i didn't want to change
-	   the api just yet */
+	/* use a hash of string chunks to associate the returned uid lists
+	 * with the backing string chunk.  yes pretty weird, but i didn't
+	 * want to change the api just yet */
 
-	p->mempool_hash = g_hash_table_new(0, 0);
+	p->string_chunk_hash = g_hash_table_new(0, 0);
 }
 
 static void
-free_mempool(void *key, void *value, void *data)
+free_string_chunk (void *key, void *value, void *data)
 {
 	GPtrArray *uids = key;
-	EMemPool *pool = value;
+	GStringChunk *string_chunk = value;
 
 	g_warning("Search closed with outstanding result unfreed: %p", uids);
 
 	g_ptr_array_free(uids, TRUE);
-	e_mempool_destroy(pool);
+	g_string_chunk_free(string_chunk);
 }
 
 static void
@@ -153,8 +153,8 @@ camel_folder_search_finalize (CamelObjec
 		g_hash_table_destroy(search->summary_hash);
 
 	g_free(search->last_search);
-	g_hash_table_foreach(p->mempool_hash, free_mempool, obj);
-	g_hash_table_destroy(p->mempool_hash);
+	g_hash_table_foreach(p->string_chunk_hash, free_string_chunk, obj);
+	g_hash_table_destroy(p->string_chunk_hash);
 	g_free(p);
 }
 
@@ -344,7 +344,7 @@ camel_folder_search_execute_expression(C
 	GPtrArray *matches;
 	int i;
 	GHashTable *results;
-	EMemPool *pool;
+	GStringChunk *string_chunk;
 	struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
 
 	p->ex = ex;
@@ -373,11 +373,7 @@ camel_folder_search_execute_expression(C
 	/* now create a folder summary to return?? */
 	if (r->type == ESEXP_RES_ARRAY_PTR) {
 		d(printf("got result ...\n"));
-		/* we use a mempool to store the strings, packed in tight as possible, and freed together */
-		/* because the strings are often short (like <8 bytes long), we would be wasting appx 50%
-		   of memory just storing the size tag that malloc assigns us and alignment padding, so this
-		   gets around that (and is faster to allocate and free as a bonus) */
-		pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
+		string_chunk = g_string_chunk_new(512);
 		if (search->summary) {
 			/* reorder result in summary order */
 			results = g_hash_table_new(g_str_hash, g_str_equal);
@@ -389,20 +385,21 @@ camel_folder_search_execute_expression(C
 				CamelMessageInfo *info = g_ptr_array_index(search->summary, i);
 				char *uid = (char *)camel_message_info_uid(info);
 				if (g_hash_table_lookup(results, uid)) {
-					g_ptr_array_add(matches, e_mempool_strdup(pool, uid));
+					g_ptr_array_add(matches, g_string_chunk_insert(string_chunk, uid));
 				}
 			}
 			g_hash_table_destroy(results);
 		} else {
 			for (i=0;i<r->value.ptrarray->len;i++) {
 				d(printf("adding match: %s\n", (char *)g_ptr_array_index(r->value.ptrarray, i)));
-				g_ptr_array_add(matches, e_mempool_strdup(pool, g_ptr_array_index(r->value.ptrarray, i)));
+				g_ptr_array_add(matches, g_string_chunk_insert(string_chunk, g_ptr_array_index(r->value.ptrarray, i)));
 			}
 		}
-		/* instead of putting the mempool_hash in the structure, we keep the api clean by
-		   putting a reference to it in a hashtable.  Lets us do some debugging and catch
-		   unfree'd results as well. */
-		g_hash_table_insert(p->mempool_hash, matches, pool);
+		/* instead of putting the string_chunk_hash in the structure,
+		 * we keep the api clean by putting a reference to it in a
+		 * hashtable.  Lets us do some debugging and catch unfree'd
+		 * results as well. */
+		g_hash_table_insert(p->string_chunk_hash, matches, string_chunk);
 	} else {
 		g_warning("Search returned an invalid result type");
 	}
@@ -443,7 +440,7 @@ camel_folder_search_search(CamelFolderSe
 	GPtrArray *matches = NULL, *summary_set;
 	int i;
 	GHashTable *results;
-	EMemPool *pool;
+	GStringChunk *string_chunk;
 	struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
 
 	g_assert(search->folder);
@@ -495,12 +492,7 @@ camel_folder_search_search(CamelFolderSe
 	/* now create a folder summary to return?? */
 	if (r->type == ESEXP_RES_ARRAY_PTR) {
 		d(printf("got result ...\n"));
-
-		/* we use a mempool to store the strings, packed in tight as possible, and freed together */
-		/* because the strings are often short (like <8 bytes long), we would be wasting appx 50%
-		   of memory just storing the size tag that malloc assigns us and alignment padding, so this
-		   gets around that (and is faster to allocate and free as a bonus) */
-		pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
+		string_chunk = g_string_chunk_new(512);
 		/* reorder result in summary order */
 		results = g_hash_table_new(g_str_hash, g_str_equal);
 		for (i=0;i<r->value.ptrarray->len;i++) {
@@ -512,14 +504,15 @@ camel_folder_search_search(CamelFolderSe
 			CamelMessageInfo *info = g_ptr_array_index(summary_set, i);
 			char *uid = (char *)camel_message_info_uid(info);
 			if (g_hash_table_lookup(results, uid))
-				g_ptr_array_add(matches, e_mempool_strdup(pool, uid));
+				g_ptr_array_add(matches, g_string_chunk_insert(string_chunk, uid));
 		}
 		g_hash_table_destroy(results);
 
-		/* instead of putting the mempool_hash in the structure, we keep the api clean by
-		   putting a reference to it in a hashtable.  Lets us do some debugging and catch
-		   unfree'd results as well. */
-		g_hash_table_insert(p->mempool_hash, matches, pool);
+		/* instead of putting the string_chunk_hash in the structure,
+		 * we keep the api clean by putting a reference to it in a
+		 * hashtable.  Lets us do some debugging and catch unfree'd
+		 * results as well. */
+		g_hash_table_insert(p->string_chunk_hash, matches, string_chunk);
 	} else {
 		g_warning("Search returned an invalid result type");
 	}
@@ -552,12 +545,12 @@ void camel_folder_search_free_result(Cam
 {
 	int i;
 	struct _CamelFolderSearchPrivate *p = _PRIVATE(search);
-	EMemPool *pool;
+	GStringChunk *string_chunk;
 
-	pool = g_hash_table_lookup(p->mempool_hash, result);
-	if (pool) {
-		e_mempool_destroy(pool);
-		g_hash_table_remove(p->mempool_hash, result);
+	string_chunk = g_hash_table_lookup(p->string_chunk_hash, result);
+	if (string_chunk) {
+		g_string_chunk_free(string_chunk);
+		g_hash_table_remove(p->string_chunk_hash, result);
 	} else {
 		for (i=0;i<result->len;i++)
 			g_free(g_ptr_array_index(result, i));
Index: camel/camel-folder-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder-summary.c,v
retrieving revision 1.150
diff -u -p -r1.150 camel-folder-summary.c
--- camel/camel-folder-summary.c	24 Jul 2006 13:40:46 -0000	1.150
+++ camel/camel-folder-summary.c	26 Oct 2006 03:01:39 -0000
@@ -134,10 +134,6 @@ camel_folder_summary_init (CamelFolderSu
 	s->message_info_chunks = NULL;
 	s->content_info_chunks = NULL;
 
-#if defined (DOESTRV) || defined (DOEPOOLV)
-	s->message_info_strings = CAMEL_MESSAGE_INFO_LAST;
-#endif
-
 	s->version = CAMEL_FOLDER_SUMMARY_VERSION;
 	s->flags = 0;
 	s->time = 0;
@@ -872,13 +868,6 @@ camel_folder_summary_add(CamelFolderSumm
 		return;
 
 	CAMEL_SUMMARY_LOCK(s, summary_lock);
-
-/* unnecessary for pooled vectors */
-#ifdef DOESTRV
-	/* this is vitally important, and also if this is ever modified, then
-	   the hash table needs to be resynced */
-	info->strings = e_strv_pack(info->strings);
-#endif
 
 	g_ptr_array_add(s->messages, info);
 	g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
Index: camel/camel-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-folder.c,v
retrieving revision 1.215
diff -u -p -r1.215 camel-folder.c
--- camel/camel-folder.c	15 Jun 2006 15:22:10 -0000	1.215
+++ camel/camel-folder.c	26 Oct 2006 03:01:41 -0000
@@ -1890,7 +1890,7 @@ camel_folder_free_deep (CamelFolder *fol
 struct _CamelFolderChangeInfoPrivate {
 	GHashTable *uid_stored;	/* what we have stored, which array they're in */
 	GHashTable *uid_source;	/* used to create unique lists */
-	struct _EMemPool *uid_pool;	/* pool used to store copies of uid strings */
+	GStringChunk *uid_string_chunk;  /* used to store copies of uid strings */
 };
 
 
@@ -1917,7 +1917,7 @@ camel_folder_change_info_new(void)
 	info->priv = g_malloc0(sizeof(*info->priv));
 	info->priv->uid_stored = g_hash_table_new(g_str_hash, g_str_equal);
 	info->priv->uid_source = NULL;
-	info->priv->uid_pool = e_mempool_new(512, 256, E_MEMPOOL_ALIGN_BYTE);
+	info->priv->uid_string_chunk = g_string_chunk_new(512);
 
 	return info;
 }
@@ -1943,7 +1943,7 @@ camel_folder_change_info_add_source(Came
 		p->uid_source = g_hash_table_new(g_str_hash, g_str_equal);
 
 	if (g_hash_table_lookup(p->uid_source, uid) == NULL)
-		g_hash_table_insert(p->uid_source, e_mempool_strdup(p->uid_pool, uid), GINT_TO_POINTER (1));
+		g_hash_table_insert(p->uid_source, g_string_chunk_insert(p->uid_string_chunk, uid), GINT_TO_POINTER (1));
 }
 
 
@@ -1972,7 +1972,7 @@ camel_folder_change_info_add_source_list
 		char *uid = list->pdata[i];
 
 		if (g_hash_table_lookup(p->uid_source, uid) == NULL)
-			g_hash_table_insert(p->uid_source, e_mempool_strdup(p->uid_pool, uid), GINT_TO_POINTER (1));
+			g_hash_table_insert(p->uid_source, g_string_chunk_insert(p->uid_string_chunk, uid), GINT_TO_POINTER (1));
 	}
 }
 
@@ -2132,7 +2132,7 @@ camel_folder_change_info_add_uid(CamelFo
 		return;
 	}
 
-	olduid = e_mempool_strdup(p->uid_pool, uid);
+	olduid = g_string_chunk_insert(p->uid_string_chunk, uid);
 	g_ptr_array_add(info->uid_added, olduid);
 	g_hash_table_insert(p->uid_stored, olduid, info->uid_added);
 }
@@ -2166,7 +2166,7 @@ camel_folder_change_info_remove_uid(Came
 		return;
 	}
 
-	olduid = e_mempool_strdup(p->uid_pool, uid);
+	olduid = g_string_chunk_insert(p->uid_string_chunk, uid);
 	g_ptr_array_add(info->uid_removed, olduid);
 	g_hash_table_insert(p->uid_stored, olduid, info->uid_removed);
 }
@@ -2195,7 +2195,7 @@ camel_folder_change_info_change_uid(Came
 		return;
 	}
 
-	olduid = e_mempool_strdup(p->uid_pool, uid);
+	olduid = g_string_chunk_insert(p->uid_string_chunk, uid);
 	g_ptr_array_add(info->uid_changed, olduid);
 	g_hash_table_insert(p->uid_stored, olduid, info->uid_changed);
 }
@@ -2221,7 +2221,7 @@ camel_folder_change_info_recent_uid(Came
 
 	/* always add to recent, but dont let anyone else know */	
 	if (!g_hash_table_lookup_extended(p->uid_stored, uid, (void **)&olduid, (void **)&olduids)) {
-		olduid = e_mempool_strdup(p->uid_pool, uid);
+		olduid = g_string_chunk_insert(p->uid_string_chunk, uid);
 	}
 	g_ptr_array_add(info->uid_recent, olduid);
 }
@@ -2270,7 +2270,8 @@ camel_folder_change_info_clear(CamelFold
 	}
 	g_hash_table_destroy(p->uid_stored);
 	p->uid_stored = g_hash_table_new(g_str_hash, g_str_equal);
-	e_mempool_flush(p->uid_pool, TRUE);
+	g_string_chunk_free(p->uid_string_chunk);
+	p->uid_string_chunk = g_string_chunk_new(512);
 }
 
 
@@ -2293,7 +2294,7 @@ camel_folder_change_info_free(CamelFolde
 		g_hash_table_destroy(p->uid_source);
 
 	g_hash_table_destroy(p->uid_stored);
-	e_mempool_destroy(p->uid_pool);
+	g_string_chunk_free(p->uid_string_chunk);
 	g_free(p);
 
 	g_ptr_array_free(info->uid_added, TRUE);
Index: camel/camel-mime-parser.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-parser.c,v
retrieving revision 1.68
diff -u -p -r1.68 camel-mime-parser.c
--- camel/camel-mime-parser.c	12 Apr 2006 19:14:13 -0000	1.68
+++ camel/camel-mime-parser.c	26 Oct 2006 03:01:42 -0000
@@ -122,7 +122,7 @@ struct _header_scan_stack {
 	camel_mime_parser_state_t savestate; /* state at invocation of this part */
 
 #ifdef MEMPOOL
-	EMemPool *pool;		/* memory pool to keep track of headers/etc at this level */
+	GStringChunk *string_chunk;  /* string chunk to keep track of headers/etc at this level */
 #endif
 	struct _camel_header_raw *headers;	/* headers for this part */
 
@@ -1001,7 +1001,8 @@ folder_pull_part(struct _header_scan_sta
 		s->parts = h->parent;
 		g_free(h->boundary);
 #ifdef MEMPOOL
-		e_mempool_destroy(h->pool);
+		if (h->string_chunk != NULL)
+			g_string_chunk_free(h->string_chunk);
 #else
 		camel_header_raw_clear(&h->headers);
 #endif
@@ -1109,20 +1110,16 @@ header_append_mempool(struct _header_sca
 	content = strchr(header, ':');
 	if (content) {
 		register int len;
-		n = e_mempool_alloc(h->pool, sizeof(*n));
+		n = g_malloc(sizeof(*n));
 		n->next = NULL;
 		
 		len = content-header;
-		n->name = e_mempool_alloc(h->pool, len+1);
-		memcpy(n->name, header, len);
-		n->name[len] = 0;
+		n->name = g_string_chunk_insert_len(h->string_chunk, header, len);
 		
 		content++;
 		
 		len = s->outptr - content;
-		n->value = e_mempool_alloc(h->pool, len+1);
-		memcpy(n->value, content, len);
-		n->value[len] = 0;
+		n->value = g_string_chunk_insert_len(h->string_chunk, content, len);
 		
 		n->offset = offset;
 		
@@ -1180,7 +1177,7 @@ folder_scan_header(struct _header_scan_s
 
 	h = g_malloc0(sizeof(*h));
 #ifdef MEMPOOL
-	h->pool = e_mempool_new(8192, 4096, E_MEMPOOL_ALIGN_STRUCT);
+	h->string_chunk = g_string_chunk_new(8192);
 #endif
 
 	if (s->parts)
Index: camel/camel-text-index.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-text-index.c,v
retrieving revision 1.25
diff -u -p -r1.25 camel-text-index.c
--- camel/camel-text-index.c	12 Apr 2006 19:14:13 -0000	1.25
+++ camel/camel-text-index.c	26 Oct 2006 03:01:45 -0000
@@ -68,7 +68,7 @@ typedef struct _CamelTextIndexNamePrivat
 struct _CamelTextIndexNamePrivate {
 	GString *buffer;
 	camel_key_t nameid;
-	EMemPool *pool;
+	GStringChunk *string_chunk;
 };
 
 CamelTextIndexName *camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid);
@@ -1371,7 +1371,7 @@ text_index_name_add_word(CamelIndexName 
 	struct _CamelTextIndexNamePrivate *p = ((CamelTextIndexName *)idn)->priv;
 
 	if (g_hash_table_lookup(idn->words, word) == NULL) {
-		char *w = e_mempool_strdup(p->pool, word);
+		char *w = g_string_chunk_insert(p->string_chunk, word);
 
 		g_hash_table_insert(idn->words, w, w);
 	}
@@ -1499,7 +1499,7 @@ camel_text_index_name_init(CamelTextInde
 
 	p = idn->priv = g_malloc0(sizeof(*idn->priv));
 	p->buffer = g_string_new("");
-	p->pool = e_mempool_new(256, 128, E_MEMPOOL_ALIGN_BYTE);
+	p->string_chunk = g_string_chunk_new(256);
 }
 
 static void
@@ -1510,7 +1510,7 @@ camel_text_index_name_finalise(CamelText
 	g_hash_table_destroy(idn->parent.words);
 
 	g_string_free(p->buffer, TRUE);
-	e_mempool_destroy(p->pool);
+	g_string_chunk_free(p->string_chunk);
 
 	g_free(p);
 }
@@ -1542,7 +1542,7 @@ camel_text_index_name_new(CamelTextIndex
 
 	cin->index = (CamelIndex *)idx;
 	camel_object_ref((CamelObject *)idx);
-	cin->name = e_mempool_strdup(p->pool, name);
+	cin->name = g_string_chunk_insert(p->string_chunk, name);
 	p->nameid = nameid;
 
 	return idn;
Index: camel/camel-vee-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-vee-folder.c,v
retrieving revision 1.79
diff -u -p -r1.79 camel-vee-folder.c
--- camel/camel-vee-folder.c	12 Apr 2006 19:14:13 -0000	1.79
+++ camel/camel-vee-folder.c	26 Oct 2006 03:01:47 -0000
@@ -28,10 +28,6 @@
 
 #include "libedataserver/md5-utils.h"
 
-#if defined (DOEPOOLV) || defined (DOESTRV)
-#include "libedataserver/e-memory.h"
-#endif
-
 #include "camel-debug.h"
 #include "camel-exception.h"
 #include "camel-folder-search.h"
Index: camel/providers/local/camel-maildir-summary.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/camel-maildir-summary.c,v
retrieving revision 1.28
diff -u -p -r1.28 camel-maildir-summary.c
--- camel/providers/local/camel-maildir-summary.c	31 Aug 2005 04:26:06 -0000	1.28
+++ camel/providers/local/camel-maildir-summary.c	26 Oct 2006 03:01:49 -0000
@@ -129,10 +129,6 @@ camel_maildir_summary_init (CamelMaildir
 	s->message_info_size = sizeof(CamelMaildirMessageInfo);
 	s->content_info_size = sizeof(CamelMaildirMessageContentInfo);
 
-#if defined (DOEPOOLV) || defined (DOESTRV)
-	s->message_info_strings = CAMEL_MAILDIR_INFO_LAST;
-#endif
-
 	if (gethostname(hostname, 256) == 0) {
 		o->priv->hostname = g_strdup(hostname);
 	} else {
@@ -329,11 +325,9 @@ static CamelMessageInfo *message_info_ne
 
 static void message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
 {
-#if !defined (DOEPOOLV) && !defined (DOESTRV)
 	CamelMaildirMessageInfo *mdi = (CamelMaildirMessageInfo *)mi;
 
 	g_free(mdi->filename);
-#endif
 	((CamelFolderSummaryClass *) parent_class)->message_info_free(s, mi);
 }
 
@@ -412,7 +406,7 @@ static int maildir_summary_load(CamelLoc
 	struct dirent *d;
 	CamelMaildirSummary *mds = (CamelMaildirSummary *)cls;
 	char *uid;
-	EMemPool *pool;
+	GStringChunk *string_chunk;
 	int ret;
 
 	cur = g_strdup_printf("%s/cur", cls->folder_path);
@@ -429,7 +423,7 @@ static int maildir_summary_load(CamelLoc
 	}
 
 	mds->priv->load_map = g_hash_table_new(g_str_hash, g_str_equal);
-	pool = e_mempool_new(1024, 512, E_MEMPOOL_ALIGN_BYTE);
+	string_chunk = g_string_chunk_new(1024);
 
 	while ( (d = readdir(dir)) ) {
 		if (d->d_name[0] == '.')
@@ -438,13 +432,13 @@ static int maildir_summary_load(CamelLoc
 		/* map the filename -> uid */
 		uid = strchr(d->d_name, ':');
 		if (uid) {
-			int len = uid-d->d_name;
-			uid = e_mempool_alloc(pool, len+1);
-			memcpy(uid, d->d_name, len);
-			uid[len] = 0;
-			g_hash_table_insert(mds->priv->load_map, uid, e_mempool_strdup(pool, d->d_name));
+			char *cp = uid;
+			*cp = '\0';
+			uid = g_string_chunk_insert(string_chunk, uid);
+			*cp = ':';
+			g_hash_table_insert(mds->priv->load_map, uid, g_string_chunk_insert(string_chunk, d->d_name));
 		} else {
-			uid = e_mempool_strdup(pool, d->d_name);
+			uid = g_string_chunk_insert(string_chunk, d->d_name);
 			g_hash_table_insert(mds->priv->load_map, uid, uid);
 		}
 	}
@@ -455,7 +449,7 @@ static int maildir_summary_load(CamelLoc
 
 	g_hash_table_destroy(mds->priv->load_map);
 	mds->priv->load_map = NULL;
-	e_mempool_destroy(pool);
+	g_string_chunk_free(string_chunk);
 
 	return ret;
 }
@@ -621,23 +615,8 @@ maildir_summary_check(CamelLocalSummary 
 			filename = camel_maildir_info_filename(mdi);
 			/* TODO: only store the extension in the mdi->filename struct, not the whole lot */
 			if (filename == NULL || strcmp(filename, d->d_name) != 0) {
-#ifdef DOESTRV
-#warning "cannot modify the estrv after its been setup, for mt-safe code"
-				CAMEL_SUMMARY_LOCK(s, summary_lock);
-				/* need to update the summary hash ref */
-				g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
-				info->strings = e_strv_set_ref(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name);
-				info->strings = e_strv_pack(info->strings);
-				g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
-				CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
-# ifdef DOEPOOLV
-				info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE);
-# else	
 				g_free(mdi->filename);
 				mdi->filename = g_strdup(d->d_name);
-# endif
-#endif
 			}
 			camel_message_info_free(info);
 		}
@@ -727,9 +706,6 @@ maildir_summary_sync(CamelLocalSummary *
 	int count, i;
 	CamelMessageInfo *info;
 	CamelMaildirMessageInfo *mdi;
-#ifdef DOESTRV
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
-#endif
 	char *name;
 	struct stat st;
 
@@ -775,26 +751,8 @@ maildir_summary_sync(CamelLocalSummary *
 					/* we'll assume it didn't work, but dont change anything else */
 					g_free(newname);
 				} else {
-					/* TODO: If this is made mt-safe, then this code could be a problem, since
-					   the estrv is being modified.
-					   Sigh, this may mean the maildir name has to be cached another way */
-#ifdef DOESTRV
-#warning "cannot modify the estrv after its been setup, for mt-safe code"
-					CAMEL_SUMMARY_LOCK(s, summary_lock);
-					/* need to update the summary hash ref */
-					g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
-					info->strings = e_strv_set_ref_free(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname);
-					info->strings = e_strv_pack(info->strings);
-					g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
-					CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
-# ifdef DOEPOOLV
-					info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE);
-# else
 					g_free(mdi->filename);
 					mdi->filename = newname;
-# endif
-#endif
 				}
 				g_free(name);
 				g_free(dest);
Index: libedataserver/e-memory.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserver/e-memory.c,v
retrieving revision 1.6
diff -u -p -r1.6 e-memory.c
--- libedataserver/e-memory.c	31 Aug 2005 04:26:10 -0000	1.6
+++ libedataserver/e-memory.c	26 Oct 2006 03:01:53 -0000
@@ -26,21 +26,6 @@
 #include <stdlib.h> /* alloca() */
 #include <glib.h>
 
-#define s(x)			/* strv debug */
-#define p(x)   /* poolv debug */
-#define p2(x)   /* poolv assertion checking */
-
-/*#define MALLOC_CHECK*/
-
-/*#define PROFILE_POOLV*/
-
-#ifdef PROFILE_POOLV
-#include <time.h>
-#define pp(x) x
-#else
-#define pp(x)
-#endif
-
 /*#define TIMEIT*/
 
 #ifdef TIMEIT
@@ -71,35 +56,6 @@ static time_end(const char *desc)
 #define time_end(x)
 #endif
 
-#ifdef MALLOC_CHECK
-#include <mcheck.h>
-#include <stdio.h>
-static void
-checkmem(void *p)
-{
-	if (p) {
-		int status = mprobe(p);
-
-		switch (status) {
-		case MCHECK_HEAD:
-			printf("Memory underrun at %p\n", p);
-			abort();
-		case MCHECK_TAIL:
-			printf("Memory overrun at %p\n", p);
-			abort();
-		case MCHECK_FREE:
-			printf("Double free %p\n", p);
-			abort();
-		}
-	}
-}
-#define MPROBE(x) checkmem((void *)(x))
-#else
-#define MPROBE(x)
-#endif
-
-/* mempool class */
-
 typedef struct _MemChunkFreeNode {
 	struct _MemChunkFreeNode *next;
 	unsigned int atoms;
@@ -351,859 +307,6 @@ e_memchunk_destroy(MemChunk *m)
 	g_free(m);
 }
 
-typedef struct _MemPoolNode {
-	struct _MemPoolNode *next;
-
-	int free;
-} MemPoolNode;
-
-typedef struct _MemPoolThresholdNode {
-	struct _MemPoolThresholdNode *next;
-} MemPoolThresholdNode;
-
-#define ALIGNED_SIZEOF(t)	((sizeof (t) + G_MEM_ALIGN - 1) & -G_MEM_ALIGN)
-
-typedef struct _EMemPool {
-	int blocksize;
-	int threshold;
-	unsigned int align;
-	struct _MemPoolNode *blocks;
-	struct _MemPoolThresholdNode *threshold_blocks;
-} MemPool;
-
-/* a pool of mempool header blocks */
-static MemChunk *mempool_memchunk;
-#ifdef G_THREADS_ENABLED
-static GStaticMutex mempool_mutex = G_STATIC_MUTEX_INIT;
-#endif
-
-/**
- * e_mempool_new:
- * @blocksize: The base blocksize to use for all system alocations.
- * @threshold: If the allocation exceeds the threshold, then it is
- * allocated separately and stored in a separate list.
- * @flags: Alignment options: E_MEMPOOL_ALIGN_STRUCT uses native
- * struct alignment, E_MEMPOOL_ALIGN_WORD aligns to 16 bits (2 bytes),
- * and E_MEMPOOL_ALIGN_BYTE aligns to the nearest byte.  The default
- * is to align to native structures.
- * 
- * Create a new mempool header.  Mempools can be used to efficiently
- * allocate data which can then be freed as a whole.
- *
- * Mempools can also be used to efficiently allocate arbitrarily
- * aligned data (such as strings) without incurring the space overhead
- * of aligning each allocation (which is not required for strings).
- *
- * However, each allocation cannot be freed individually, only all
- * or nothing.
- * 
- * Return value: 
- **/
-MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
-{
-	MemPool *pool;
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_lock(&mempool_mutex);
-#endif
-	if (mempool_memchunk == NULL) {
-		mempool_memchunk = e_memchunk_new(8, sizeof(MemPool));
-	}
-	pool = e_memchunk_alloc(mempool_memchunk);
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_unlock(&mempool_mutex);
-#endif
-	if (threshold >= blocksize)
-		threshold = blocksize * 2 / 3;
-	pool->blocksize = blocksize;
-	pool->threshold = threshold;
-	pool->blocks = NULL;
-	pool->threshold_blocks = NULL;
-
-	switch (flags & E_MEMPOOL_ALIGN_MASK) {
-	case E_MEMPOOL_ALIGN_STRUCT:
-	default:
-		pool->align = G_MEM_ALIGN-1;
-		break;
-	case E_MEMPOOL_ALIGN_WORD:
-		pool->align = 2-1;
-		break;
-	case E_MEMPOOL_ALIGN_BYTE:
-		pool->align = 1-1;
-	}
-	return pool;
-}
-
-/**
- * e_mempool_alloc:
- * @pool: 
- * @size: 
- * 
- * Allocate a new data block in the mempool.  Size will
- * be rounded up to the mempool's alignment restrictions
- * before being used.
- **/
-void *e_mempool_alloc(MemPool *pool, register int size)
-{
-	size = (size + pool->align) & (~(pool->align));
-	if (size>=pool->threshold) {
-		MemPoolThresholdNode *n;
-
-		n = g_malloc(ALIGNED_SIZEOF(*n) + size);
-		n->next = pool->threshold_blocks;
-		pool->threshold_blocks = n;
-		return (char *) n + ALIGNED_SIZEOF(*n);
-	} else {
-		register MemPoolNode *n;
-
-		n = pool->blocks;
-		if (n && n->free >= size) {
-			n->free -= size;
-			return (char *) n + ALIGNED_SIZEOF(*n) + n->free;
-		}
-
-		/* maybe we could do some sort of the free blocks based on size, but
-		   it doubt its worth it at all */
-
-		n = g_malloc(ALIGNED_SIZEOF(*n) + pool->blocksize);
-		n->next = pool->blocks;
-		pool->blocks = n;
-		n->free = pool->blocksize - size;
-		return (char *) n + ALIGNED_SIZEOF(*n) + n->free;
-	}
-}
-
-char *e_mempool_strdup(EMemPool *pool, const char *str)
-{
-	char *out;
-
-	out = e_mempool_alloc(pool, strlen(str)+1);
-	strcpy(out, str);
-
-	return out;
-}
-
-/**
- * e_mempool_flush:
- * @pool: 
- * @freeall: Free all system allocated blocks as well.
- * 
- * Flush used memory and mark allocated blocks as free.
- *
- * If @freeall is #TRUE, then all allocated blocks are free'd
- * as well.  Otherwise only blocks above the threshold are
- * actually freed, and the others are simply marked as empty.
- **/
-void e_mempool_flush(MemPool *pool, int freeall)
-{
-	MemPoolThresholdNode *tn, *tw;
-	MemPoolNode *pw, *pn;
-
-	tw = pool->threshold_blocks;
-	while (tw) {
-		tn = tw->next;
-		g_free(tw);
-		tw = tn;
-	}
-	pool->threshold_blocks = NULL;
-
-	if (freeall) {
-		pw = pool->blocks;
-		while (pw) {
-			pn = pw->next;
-			g_free(pw);
-			pw = pn;
-		}
-		pool->blocks = NULL;
-	} else {
-		pw = pool->blocks;
-		while (pw) {
-			pw->free = pool->blocksize;
-			pw = pw->next;
-		}
-	}
-}
-
-/**
- * e_mempool_destroy:
- * @pool: 
- * 
- * Free all memory associated with a mempool.
- **/
-void e_mempool_destroy(MemPool *pool)
-{
-	if (pool) {
-		e_mempool_flush(pool, 1);
-#ifdef G_THREADS_ENABLED
-		g_static_mutex_lock(&mempool_mutex);
-#endif
-		e_memchunk_free(mempool_memchunk, pool);
-#ifdef G_THREADS_ENABLED
-		g_static_mutex_unlock(&mempool_mutex);
-#endif
-	}
-}
-
-
-/*
-  string array classes
-*/
-
-#define STRV_UNPACKED ((unsigned char)(~0))
-
-struct _EStrv {
-	unsigned char length;	/* how many entries we have (or the token STRV_UNPACKED) */
-	char data[1];		/* data follows */
-};
-
-struct _s_strv_string {
-	char *string;		/* the string to output */
-	char *free;		/* a string to free, if we referenced it */
-};
-
-struct _e_strvunpacked {
-	unsigned char type;	/* we overload last to indicate this is unpacked */
-	MemPool *pool;		/* pool of memory for strings */
-	struct _EStrv *source;	/* if we were converted from a packed one, keep the source around for a while */
-	unsigned int length;
-	struct _s_strv_string strings[1]; /* the string array data follows */
-};
-
-/**
- * e_strv_new:
- * @size: The number of elements in the strv.  Currently this is limited
- * to 254 elements.
- * 
- * Create a new strv (string array) header.  strv's can be used to
- * create and work with arrays of strings that can then be compressed
- * into a space-efficient static structure.  This is useful
- * where a number of strings are to be stored for lookup, and not
- * generally edited afterwards.
- *
- * The size limit is currently 254 elements.  This will probably not
- * change as arrays of this size suffer significant performance
- * penalties when looking up strings with high indices.
- * 
- * Return value: 
- **/
-struct _EStrv *
-e_strv_new(int size)
-{
-	struct _e_strvunpacked *s;
-
-	g_assert(size<255);
-
-	s = g_malloc(sizeof(*s) + (size-1)*sizeof(s->strings[0]));
-	s(printf("new strv=%p, size = %d bytes\n", s, sizeof(*s) + (size-1)*sizeof(char *)));
-	s->type = STRV_UNPACKED;
-	s->pool = NULL;
-	s->length = size;
-	s->source = NULL;
-	memset(s->strings, 0, size*sizeof(s->strings[0]));
-
-	return (struct _EStrv *)s;
-}
-
-static struct _e_strvunpacked *
-strv_unpack(struct _EStrv *strv)
-{
-	struct _e_strvunpacked *s;
-	register char *p;
-	int i;
-
-	s(printf("unpacking\n"));
-
-	s = (struct _e_strvunpacked *)e_strv_new(strv->length);
-	p = strv->data;
-	for (i=0;i<s->length;i++) {
-		if (i>0)
-			while (*p++)
-				;
-		s->strings[i].string = p;
-	}
-	s->source = strv;
-	s->type = STRV_UNPACKED;
-
-	return s;
-}
-
-/**
- * e_strv_set_ref:
- * @strv: 
- * @index: 
- * @str: 
- * 
- * Set a string array element by reference.  The string
- * is not copied until the array is packed.
- * 
- * If @strv has been packed, then it is unpacked ready
- * for more inserts, and should be packed again once finished with.
- * The memory used by the original @strv is not freed until
- * the new strv is packed, or freed itself.
- *
- * Return value: A new EStrv if the strv has already
- * been packed, otherwise @strv.
- **/
-struct _EStrv *
-e_strv_set_ref(struct _EStrv *strv, int index, char *str)
-{
-	struct _e_strvunpacked *s;
-
-	s(printf("set ref %d '%s'\nawkmeharder: %s\n ", index, str, str));
-
-	if (strv->length != STRV_UNPACKED)
-		s = strv_unpack(strv);
-	else
-		s = (struct _e_strvunpacked *)strv;
-
-	g_assert(index>=0 && index < s->length);
-
-	s->strings[index].string = str;
-
-	return (struct _EStrv *)s;
-}
-
-/**
- * e_strv_set_ref_free:
- * @strv: 
- * @index: 
- * @str: 
- * 
- * Set a string by reference, similar to set_ref, but also
- * free the string when finished with it.  The string
- * is not copied until the strv is packed, and not at
- * all if the index is overwritten.
- * 
- * Return value: @strv if already unpacked, otherwise an packed
- * EStrv.
- **/
-struct _EStrv *
-e_strv_set_ref_free(struct _EStrv *strv, int index, char *str)
-{
-	struct _e_strvunpacked *s;
-
-	s(printf("set ref %d '%s'\nawkmeevenharder: %s\n ", index, str, str));
-
-	if (strv->length != STRV_UNPACKED)
-		s = strv_unpack(strv);
-	else
-		s = (struct _e_strvunpacked *)strv;
-
-	g_assert(index>=0 && index < s->length);
-
-	s->strings[index].string = str;
-	if (s->strings[index].free)
-		g_free(s->strings[index].free);
-	s->strings[index].free = str;
-
-	return (struct _EStrv *)s;
-}
-
-/**
- * e_strv_set:
- * @strv: 
- * @index: 
- * @str: 
- * 
- * Set a string array reference.  The string @str is copied
- * into the string array at location @index.
- * 
- * If @strv has been packed, then it is unpacked ready
- * for more inserts, and should be packed again once finished with.
- *
- * Return value: A new EStrv if the strv has already
- * been packed, otherwise @strv.
- **/
-struct _EStrv *
-e_strv_set(struct _EStrv *strv, int index, const char *str)
-{
-	struct _e_strvunpacked *s;
-
-	s(printf("set %d '%s'\n", index, str));
-
-	if (strv->length != STRV_UNPACKED)
-		s = strv_unpack(strv);
-	else
-		s = (struct _e_strvunpacked *)strv;
-
-	g_assert(index>=0 && index < s->length);
-
-	if (s->pool == NULL)
-		s->pool = e_mempool_new(1024, 512, E_MEMPOOL_ALIGN_BYTE);
-
-	s->strings[index].string = e_mempool_alloc(s->pool, strlen(str)+1);
-	strcpy(s->strings[index].string, str);
-
-	return (struct _EStrv *)s;
-}
-
-/**
- * e_strv_pack:
- * @strv: 
- * 
- * Pack the @strv into a space efficient structure for later lookup.
- *
- * All strings are packed into a single allocated block, separated
- * by single \0 characters, together with a count byte.
- * 
- * Return value: 
- **/
-struct _EStrv *
-e_strv_pack(struct _EStrv *strv)
-{
-	struct _e_strvunpacked *s;
-	int len, i;
-	register char *src, *dst;
-
-	if (strv->length == STRV_UNPACKED) {
-		s = (struct _e_strvunpacked *)strv;
-
-		s(printf("packing string\n"));
-
-		len = 0;
-		for (i=0;i<s->length;i++)
-			len += s->strings[i].string?strlen(s->strings[i].string)+1:1;
-
-		strv = g_malloc(sizeof(*strv) + len);
-		s(printf("allocating strv=%p, size = %d\n", strv, sizeof(*strv)+len));
-		strv->length = s->length;
-		dst = strv->data;
-		for (i=0;i<s->length;i++) {
-			if ((src = s->strings[i].string)) {
-				while ((*dst++ = *src++))
-					;
-			} else {
-				*dst++ = 0;
-			}
-		}
-		e_strv_destroy((struct _EStrv *)s);
-	}
-	return strv;
-}
-
-/**
- * e_strv_get:
- * @strv: 
- * @index: 
- * 
- * Retrieve a string by index.  This function works
- * identically on both packed and unpacked strv's, although
- * may be much slower on a packed strv.
- * 
- * Return value: 
- **/
-char *
-e_strv_get(struct _EStrv *strv, int index)
-{
-	struct _e_strvunpacked *s;
-	char *p;
-
-	if (strv->length != STRV_UNPACKED) {
-		g_assert(index>=0 && index < strv->length);
-		p = strv->data;
-		while (index > 0) {
-			while (*p++ != 0)
-				;
-			index--;
-		}
-		return p;
-	} else {
-		s = (struct _e_strvunpacked *)strv;
-		g_assert(index>=0 && index < s->length);
-		return s->strings[index].string?s->strings[index].string:"";
-	}
-}
-
-/**
- * e_strv_destroy:
- * @strv: 
- * 
- * Free a strv and all associated memory.  Works on packed
- * or unpacked strv's.
- **/
-void
-e_strv_destroy(struct _EStrv *strv)
-{
-	struct _e_strvunpacked *s;
-	int i;
-
-	s(printf("freeing strv\n"));
-
-	if (strv->length == STRV_UNPACKED) {
-		s = (struct _e_strvunpacked *)strv;
-		if (s->pool)
-			e_mempool_destroy(s->pool);
-		if (s->source)
-			e_strv_destroy(s->source);
-		for (i=0;i<s->length;i++) {
-			if (s->strings[i].free)
-				g_free(s->strings[i].free);
-		}
-	}
-
-	s(printf("freeing strv=%p\n", strv));
-
-	g_free(strv);
-}
-
-
-
-/* string pool stuff */
-
-/* TODO:
-    garbage collection, using the following technique:
-      Create a memchunk for each possible size of poolv, and allocate every poolv from those
-      To garbage collect, scan all memchunk internally, ignoring any free areas (or mark each
-        poolv when freeing it - set length 0?), and find out which strings are not anywhere,
-	then free them.
-
-    OR:
-       Just keep a refcount in the hashtable, instead of duplicating the key pointer.
-
-   either would also require a free for the mempool, so ignore it for now */
-
-/*#define POOLV_REFCNT*/ /* Define to enable refcounting code that does
-			automatic garbage collection of unused strings */
-
-static GHashTable *poolv_pool = NULL;
-static EMemPool *poolv_mempool = NULL;
-
-#ifdef MALLOC_CHECK
-static GPtrArray *poolv_table = NULL;
-#endif
-
-#ifdef PROFILE_POOLV
-static gulong poolv_hits = 0;
-static gulong poolv_misses = 0;
-static unsigned long poolv_mem, poolv_count;
-#endif
-
-#ifdef G_THREADS_ENABLED
-static GStaticMutex poolv_mutex = G_STATIC_MUTEX_INIT;
-#endif
-
-struct _EPoolv {
-	unsigned char length;
-	char *s[1];
-};
-
-/**
- * e_poolv_new: @size: The number of elements in the poolv, maximum of 254 elements.
- *
- * create a new poolv (string vector which shares a global string
- * pool).  poolv's can be used to work with arrays of strings which
- * save memory by eliminating duplicated allocations of the same
- * string.
- *
- * this is useful when you have a log of read-only strings that do not
- * go away and are duplicated a lot (such as email headers).
- *
- * we should probably in the future ref count the strings contained in
- * the hash table, but for now let's not.
- *
- * Return value: new pooled string vector
- **/
-EPoolv *
-e_poolv_new(unsigned int size)
-{
-	EPoolv *poolv;
-
-	g_assert(size < 255);
-
-	poolv = g_malloc0(sizeof (*poolv) + (size - 1) * sizeof (char *));
-	poolv->length = size;
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_lock(&poolv_mutex);
-#endif
-	if (!poolv_pool)
-		poolv_pool = g_hash_table_new(g_str_hash, g_str_equal);
-
-	if (!poolv_mempool)
-		poolv_mempool = e_mempool_new(32 * 1024, 512, E_MEMPOOL_ALIGN_BYTE);
-
-#ifdef MALLOC_CHECK
-	{
-		int i;
-
-		if (poolv_table == NULL)
-			poolv_table = g_ptr_array_new();
-
-		for (i=0;i<poolv_table->len;i++)
-			MPROBE(poolv_table->pdata[i]);
-
-		g_ptr_array_add(poolv_table, poolv);
-	}
-#endif
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_unlock(&poolv_mutex);
-#endif
-
-	p(printf("new poolv=%p\tsize=%d\n", poolv, sizeof(*poolv) + (size-1)*sizeof(char *)));
-
-#ifdef PROFILE_POOLV
-	poolv_count++;
-#endif
-	return poolv;
-}
-
-/**
- * e_poolv_cpy:
- * @dest: destination pooled string vector
- * @src: source pooled string vector
- *
- * Copy the contents of a pooled string vector
- *
- * Return value: @dest, which may be re-allocated if the strings
- * are different lengths.
- **/
-EPoolv *
-e_poolv_cpy(EPoolv *dest, const EPoolv *src)
-{
-#ifdef POOLV_REFCNT
-	int i;
-	unsigned int ref;
-	char *key;
-#endif
-
-	p2(g_return_val_if_fail (dest != NULL, NULL));
-	p2(g_return_val_if_fail (src != NULL, NULL));
-
-	MPROBE(dest);
-	MPROBE(src);
-
-	if (dest->length != src->length) {
-		e_poolv_destroy(dest);
-		dest = e_poolv_new(src->length);
-	}
-
-#ifdef POOLV_REFCNT
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_lock(&poolv_mutex);
-#endif
-	/* ref new copies */
-	for (i=0;i<src->length;i++) {
-		if (src->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, src->s[i], (void **)&key, (void **)&ref)) {
-				g_hash_table_insert(poolv_pool, key, (void *)(ref+1));
-			} else {
-				g_assert_not_reached();
-			}
-		}
-	}
-
-	/* unref the old ones */
-	for (i=0;i<dest->length;i++) {
-		if (dest->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, dest->s[i], (void **)&key, (void **)&ref)) {
-				/* if ref == 1 free it */
-				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
-			} else {
-				g_assert_not_reached();
-			}
-		}
-	}
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_unlock(&poolv_mutex);
-#endif
-#endif
-
-	memcpy(dest->s, src->s, src->length * sizeof (char *));
-
-	return dest;
-}
-
-#ifdef PROFILE_POOLV
-static void
-poolv_profile_update (void)
-{
-	static time_t last_time = 0;
-	time_t new_time;
-
-	new_time = time (NULL);
-	if (new_time - last_time < 5)
-		return;
-
-	printf("poolv profile: %lu hits, %lu misses: %d%% hit rate, memory: %lu, instances: %lu\n", 
-	       poolv_hits, poolv_misses, 
-	       (int)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))),
-	       poolv_mem, poolv_count);
-
-	last_time = new_time;
-}
-#endif
-
-/**
- * e_poolv_set:
- * @poolv: pooled string vector
- * @index: index in vector of string
- * @str: string to set
- * @freeit: whether the caller is releasing its reference to the
- * string
- *
- * Set a string vector reference.  If the caller will no longer be
- * referencing the string, freeit should be TRUE.  Otherwise, this
- * will duplicate the string if it is not found in the pool.
- *
- * Return value: @poolv
- **/
-EPoolv *
-e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
-{
-#ifdef POOLV_REFCNT
-	unsigned int ref;
-	char *key;
-#endif
-
-	p2(g_return_val_if_fail (poolv != NULL, NULL));
-
-	g_assert(index >=0 && index < poolv->length);
-
-	MPROBE(poolv);
-
-	p(printf("setting %d `%s'\n", index, str));
-
-	if (!str) {
-#ifdef POOLV_REFCNT
-		if (poolv->s[index]) {
-			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[index], (void **)&key, (void **)&ref)) {
-				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
-			} else {
-				g_assert_not_reached();
-			}
-		}
-#endif
-		poolv->s[index] = NULL;
-		return poolv;
-	}
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_lock(&poolv_mutex);
-#endif
-
-#ifdef POOLV_REFCNT
-	if (g_hash_table_lookup_extended(poolv_pool, str, (void **)&key, (void **)&ref)) {
-		g_hash_table_insert(poolv_pool, key, (void *)(ref+1));
-		poolv->s[index] = key;
-# ifdef PROFILE_POOLV
-		poolv_hits++;
-		poolv_profile_update ();
-# endif
-	} else {
-# ifdef PROFILE_POOLV
-		poolv_misses++;
-		poolv_mem += strlen(str);
-		poolv_profile_update ();
-# endif
-		poolv->s[index] = e_mempool_strdup(poolv_mempool, str);
-		g_hash_table_insert(poolv_pool, poolv->s[index], (void *)1);
-	}
-
-#else  /* !POOLV_REFCNT */
-	if ((poolv->s[index] = g_hash_table_lookup(poolv_pool, str)) != NULL) {
-# ifdef PROFILE_POOLV
-		poolv_hits++;
-		poolv_profile_update ();
-# endif
-	} else {
-# ifdef PROFILE_POOLV
-		poolv_misses++;
-		poolv_mem += strlen(str);
-		poolv_profile_update ();
-# endif
-		poolv->s[index] = e_mempool_strdup(poolv_mempool, str);
-		g_hash_table_insert(poolv_pool, poolv->s[index], poolv->s[index]);
-	}
-#endif /* !POOLV_REFCNT */
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_unlock(&poolv_mutex);
-#endif
-
-	if (freeit)
-		g_free(str);
-
-	return poolv;
-}
-
-/**
- * e_poolv_get:
- * @poolv: pooled string vector
- * @index: index in vector of string
- *
- * Retrieve a string by index.  This could possibly just be a macro.
- *
- * Since the pool is never freed, this string does not need to be
- * duplicated, but should not be modified.
- *
- * Return value: string at that index.
- **/
-const char *
-e_poolv_get(EPoolv *poolv, int index)
-{
-	g_assert(poolv != NULL);
-	g_assert(index>= 0 && index < poolv->length);
-
-	MPROBE(poolv);
-
-	p(printf("get %d = `%s'\n", index, poolv->s[index]));
-
-	return poolv->s[index]?poolv->s[index]:"";
-}
-
-/**
- * e_poolv_destroy:
- * @poolv: pooled string vector to free
- *
- * Free a pooled string vector.  This doesn't free the strings from
- * the vector, however.
- **/
-void
-e_poolv_destroy(EPoolv *poolv)
-{
-#ifdef POOLV_REFCNT
-	int i;
-	unsigned int ref;
-	char *key;
-
-	MPROBE(poolv);
-
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_lock(&poolv_mutex);
-#endif
-
-#ifdef MALLOC_CHECK
-	for (i=0;i<poolv_table->len;i++)
-		MPROBE(poolv_table->pdata[i]);
-
-	g_ptr_array_remove_fast(poolv_table, poolv);
-#endif
-
-	for (i=0;i<poolv->length;i++) {
-		if (poolv->s[i]) {
-			if (g_hash_table_lookup_extended(poolv_pool, poolv->s[i], (void **)&key, (void **)&ref)) {
-				/* if ref == 1 free it */
-				g_assert(ref > 0);
-				g_hash_table_insert(poolv_pool, key, (void *)(ref-1));
-			} else {
-				g_assert_not_reached();
-			}
-		}
-	}
-#ifdef G_THREADS_ENABLED
-	g_static_mutex_unlock(&poolv_mutex);
-#endif
-#endif
-
-#ifdef PROFILE_POOLV
-	poolv_count++;
-#endif
-	g_free(poolv);
-}
-
 #if 0
 
 #define CHUNK_SIZE (20)
@@ -1217,45 +320,8 @@ main()
 	MemChunk *mc;
 	void *mem, *last;
 	GMemChunk *gmc;
-	struct _EStrv *s;
-
-	s = strv_new(8);
-	s = strv_set(s, 1, "Testing 1");
-	s = strv_set(s, 2, "Testing 2");
-	s = strv_set(s, 3, "Testing 3");
-	s = strv_set(s, 4, "Testing 4");
-	s = strv_set(s, 5, "Testing 5");
-	s = strv_set(s, 6, "Testing 7");
-
-	for (i=0;i<8;i++) {
-		printf("s[%d] = %s\n", i, strv_get(s, i));
-	}
 
 	s(sleep(5));
-
-	printf("packing ...\n");
-	s = strv_pack(s);
-
-	for (i=0;i<8;i++) {
-		printf("s[%d] = %s\n", i, strv_get(s, i));
-	}
-
-	printf("setting ...\n");
-
-	s = strv_set_ref(s, 1, "Testing 1 x");
-
-	for (i=0;i<8;i++) {
-		printf("s[%d] = %s\n", i, strv_get(s, i));
-	}
-
-	printf("packing ...\n");
-	s = strv_pack(s);
-
-	for (i=0;i<8;i++) {
-		printf("s[%d] = %s\n", i, strv_get(s, i));
-	}
-
-	strv_free(s);
 
 #if 0
 	time_start("Using memchunks");
Index: libedataserver/e-memory.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserver/e-memory.h,v
retrieving revision 1.4
diff -u -p -r1.4 e-memory.h
--- libedataserver/e-memory.h	31 Aug 2005 04:26:10 -0000	1.4
+++ libedataserver/e-memory.h	26 Oct 2006 03:01:53 -0000
@@ -38,43 +38,6 @@ void e_memchunk_empty(EMemChunk *m);
 void e_memchunk_clean(EMemChunk *m);
 void e_memchunk_destroy(EMemChunk *m);
 
-/* mempools - allocate variable sized blocks of memory, and free as one */
-/* allocation is very fast, but cannot be freed individually */
-typedef struct _EMemPool EMemPool;
-typedef enum {
-	E_MEMPOOL_ALIGN_STRUCT = 0,	/* allocate to native structure alignment */
-	E_MEMPOOL_ALIGN_WORD = 1,	/* allocate to words - 16 bit alignment */
-	E_MEMPOOL_ALIGN_BYTE = 2,	/* allocate to bytes - 8 bit alignment */
-	E_MEMPOOL_ALIGN_MASK = 3, /* which bits determine the alignment information */
-} EMemPoolFlags;
-
-EMemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags);
-void *e_mempool_alloc(EMemPool *pool, int size);
-char *e_mempool_strdup(EMemPool *pool, const char *str);
-void e_mempool_flush(EMemPool *pool, int freeall);
-void e_mempool_destroy(EMemPool *pool);
-
-/* strv's string arrays that can be efficiently modified and then compressed mainly for retrival */
-/* building is relatively fast, once compressed it takes the minimum amount of memory possible to store */
-typedef struct _EStrv EStrv;
-
-EStrv *e_strv_new(int size);
-EStrv *e_strv_set_ref(EStrv *strv, int index, char *str);
-EStrv *e_strv_set_ref_free(EStrv *strv, int index, char *str);
-EStrv *e_strv_set(EStrv *strv, int index, const char *str);
-EStrv *e_strv_pack(EStrv *strv);
-char *e_strv_get(EStrv *strv, int index);
-void e_strv_destroy(EStrv *strv);
-
-/* poolv's are similar to strv's, but they store common strings */
-typedef struct _EPoolv EPoolv;
-
-EPoolv *e_poolv_new(unsigned int size);
-EPoolv *e_poolv_cpy(EPoolv *dest, const EPoolv *src);
-EPoolv *e_poolv_set(EPoolv *poolv, int index, char *str, int freeit);
-const char *e_poolv_get(EPoolv *poolv, int index);
-void e_poolv_destroy(EPoolv *poolv);
-
 G_END_DECLS
 
 #endif /* ! _E_MEMORY_H */
