[evolution-data-server] libedata-book: Use slice allocator for EbSdbSearchData
- From: Mathias Hasselmann <hasselmm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] libedata-book: Use slice allocator for EbSdbSearchData
- Date: Wed, 16 Jan 2013 14:30:18 +0000 (UTC)
commit 1df658a764148701feb55a8adf52b349bd0fb5ae
Author: Mathias Hasselmann <mathias openismus com>
Date: Tue Dec 11 10:53:00 2012 +0100
libedata-book: Use slice allocator for EbSdbSearchData
EbSdbSearchData is a tiny object that gets allocated for each search result.
For such objects the slice allocator must be used to improve performance and
to reduce memory fragmentation.
.../libedata-book/e-book-backend-sqlitedb.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index cca1c6d..e23c278 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -1951,7 +1951,7 @@ store_data_to_vcard (gpointer ref,
gchar **name)
{
GSList **vcard_data = ref;
- EbSdbSearchData *search_data = g_new0 (EbSdbSearchData, 1);
+ EbSdbSearchData *search_data = g_slice_new0 (EbSdbSearchData);
EContact *contact = e_contact_new ();
gchar *vcard;
gint i;
@@ -2739,7 +2739,7 @@ addto_vcard_list_cb (gpointer ref,
gchar **name)
{
GSList **vcard_data = ref;
- EbSdbSearchData *s_data = g_new0 (EbSdbSearchData, 1);
+ EbSdbSearchData *s_data = g_slice_new0 (EbSdbSearchData);
if (cols[0])
s_data->uid = g_strdup (cols[0]);
@@ -3720,7 +3720,7 @@ e_book_backend_sqlitedb_search_data_free (EbSdbSearchData *s_data)
g_free (s_data->uid);
g_free (s_data->vcard);
g_free (s_data->bdata);
- g_free (s_data);
+ g_slice_free (EbSdbSearchData, s_data);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]