[kazehakase-svn] [3535] * src/kz-profile.c: Use g_slice_new instead of g_malloc.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Jan 21 15:12:56 JST 2009


Revision: 3535
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3535
Author:   ikezoe
Date:     2009-01-21 15:12:56 +0900 (Wed, 21 Jan 2009)

Log Message:
-----------
	* src/kz-profile.c: Use g_slice_new instead of g_malloc.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/kz-profile.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-01-21 05:45:40 UTC (rev 3534)
+++ kazehakase/trunk/ChangeLog	2009-01-21 06:12:56 UTC (rev 3535)
@@ -3,6 +3,7 @@
 	* src/kz-tab-label.c: Remove redundant gtk_icon_size_lookup.
 	* src/kz-tab-label.c: Invoke idle_create_thumnail only if the option
 	is enabled.
+	* src/kz-profile.c: Use g_slice_new instead of g_malloc.
 
 2009-01-20  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/src/kz-profile.c
===================================================================
--- kazehakase/trunk/src/kz-profile.c	2009-01-21 05:45:40 UTC (rev 3534)
+++ kazehakase/trunk/src/kz-profile.c	2009-01-21 06:12:56 UTC (rev 3535)
@@ -164,7 +164,7 @@
 		g_free(p->data);
 		g_free(p->section);
 		g_free(p->key);
-		g_free(p);
+		g_slice_free(KzProfileList, p);
 	}
 	profile->list = NULL;
 
@@ -174,7 +174,7 @@
 		g_free(p->data);
 		g_free(p->section);
 		g_free(p->key);
-		g_free(p);
+		g_slice_free(KzProfileList, p);
 	}
 	profile->sublist = NULL;
 
@@ -352,7 +352,7 @@
 		if (n > 0 && data[n - 1] == '\n')
 		{
 			data[n - 1] = '\0';
-			q = g_malloc0(sizeof(KzProfileList));
+			q = g_slice_new0(KzProfileList);
 			q->data = data;
 			q->prev = p;
 			if (p)
@@ -367,7 +367,7 @@
 		{
 			q = p->prev;
 			g_free(p->data);
-			g_free(p);
+			g_slice_free(KzProfileList, p);
 			p = q;
 		}
 		return NULL;
@@ -391,7 +391,7 @@
 		else if (data[0] == '[' && data[n - 1] == ']')
 		{
 			p->type = KZ_PROFILE_DATA_TYPE_SECTION;
-			g_free (section);
+			g_free(section);
 			section = g_strdup(data + 1);
 			section[n - 2] = '\0';
 			for (q = p->prev; q && q->type == KZ_PROFILE_DATA_TYPE_SPACE;
@@ -416,7 +416,7 @@
 		g_free(data);
 		p = p->next;
 	}
-	g_free (section);
+	g_free(section);
 	return r;
 }
 
@@ -731,7 +731,7 @@
 			if (q)
 			{
 				/* insert space between previous data and current data */
-				p = g_malloc(sizeof(KzProfileList));
+				p = g_slice_new(KzProfileList);
 				p->type=KZ_PROFILE_DATA_TYPE_SPACE;
 				p->value = p->data = p->section = p->key = NULL;
 				p->prev = q;
@@ -740,7 +740,7 @@
 				q = p;
 			}
 			/* create a section if neither section and key aren't exist */
-			p = g_malloc(sizeof(KzProfileList));
+			p = g_slice_new(KzProfileList);
 			p->type = KZ_PROFILE_DATA_TYPE_SECTION;
 			p->data = g_strdup_printf("[%s]", section);
 			p->section = g_strdup(section);
@@ -765,7 +765,7 @@
 		       && g_strcmp(p->section, section) == 0 && q->prev)
 			q = q->prev;
 		/* create a key into last of the section */
-		p = g_malloc(sizeof(KzProfileList));
+		p = g_slice_new(KzProfileList);
 		p->type = KZ_PROFILE_DATA_TYPE_KEY;
 		p->data = g_strdup_printf("%s=", key);
 		p->section = g_strdup(section);
@@ -842,7 +842,7 @@
 	g_free(p->data);
 	g_free(p->section);
 	g_free(p->key);
-	g_free(p);
+	g_slice_free(KzProfileList, p);
 }
 
 



More information about the Kazehakase-cvs mailing list
Back to archive index