summaryrefslogtreecommitdiff
path: root/gdk/gdkevents.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-12-05 20:51:18 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-12-05 20:51:18 +0000
commit3353d528b453f8987d042beb2cf2ac7c59a7ba3f (patch)
tree94768d396cccc9f00c8b66b1ece6e5664660a684 /gdk/gdkevents.c
parenteb79da2f53089d6b8addecbef6730f8442fc120b (diff)
downloadgdk-pixbuf-3353d528b453f8987d042beb2cf2ac7c59a7ba3f.tar.gz
Use g_slice instead of mem chunks.
2005-12-05 Matthias Clasen <mclasen@redhat.com> * gdk/gdkevents.c: * gdk/gdkcolor.c: Use g_slice instead of mem chunks.
Diffstat (limited to 'gdk/gdkevents.c')
-rw-r--r--gdk/gdkevents.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 040ebc292..dc85f9eb9 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -255,7 +255,6 @@ gdk_event_put (GdkEvent *event)
gdk_display_put_event (display, event);
}
-static GMemChunk *event_chunk = NULL;
static GHashTable *event_hash = NULL;
/**
@@ -275,17 +274,7 @@ gdk_event_new (GdkEventType type)
GdkEventPrivate *new_private;
GdkEvent *new_event;
- if (event_chunk == NULL)
- {
- event_chunk = g_mem_chunk_new ("events",
- sizeof (GdkEventPrivate),
- 4096,
- G_ALLOC_AND_FREE);
- event_hash = g_hash_table_new (g_direct_hash, NULL);
- }
-
- new_private = g_chunk_new (GdkEventPrivate, event_chunk);
- memset (new_private, 0, sizeof (GdkEventPrivate));
+ new_private = g_slice_new0 (GdkEventPrivate);
new_private->flags = 0;
new_private->screen = NULL;
@@ -446,8 +435,6 @@ gdk_event_free (GdkEvent *event)
{
g_return_if_fail (event != NULL);
- g_assert (event_chunk != NULL); /* paranoid */
-
if (event->any.window)
g_object_unref (event->any.window);
@@ -498,7 +485,7 @@ gdk_event_free (GdkEvent *event)
}
g_hash_table_remove (event_hash, event);
- g_mem_chunk_free (event_chunk, event);
+ g_slice_free (GdkEventPrivate, event);
}
/**