diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-12-21 21:10:41 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-12-21 21:10:41 +0000 |
commit | fe0fb8966d0bdb58e1cd5fe41082922c433be3ca (patch) | |
tree | 01fb71e3795ad813d68adfb39d2e197d37e7ce22 /gdk/gdkregion-generic.c | |
parent | 2962480b2c662ffb744dc28c3710305e3219dca9 (diff) | |
download | gtk+-fe0fb8966d0bdb58e1cd5fe41082922c433be3ca.tar.gz |
Use the slice allocator for regions. Still todo: avoid extra allocations
2005-12-21 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkregion-generic.c: Use the slice allocator
for regions. Still todo: avoid extra allocations for
the single-rectangle case.
Diffstat (limited to 'gdk/gdkregion-generic.c')
-rw-r--r-- | gdk/gdkregion-generic.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/gdkregion-generic.c b/gdk/gdkregion-generic.c index 1dbdc32fb9..a7bbeb0a6c 100644 --- a/gdk/gdkregion-generic.c +++ b/gdk/gdkregion-generic.c @@ -112,7 +112,7 @@ gdk_region_new () { GdkRegion *temp; - temp = g_new (GdkRegion, 1); + temp = g_slice_new (GdkRegion); temp->rects = g_new (GdkRegionBox, 1); temp->numRects = 0; @@ -143,7 +143,7 @@ gdk_region_rectangle (GdkRectangle *rectangle) if (rectangle->width <= 0 || rectangle->height <= 0) return gdk_region_new(); - temp = g_new (GdkRegion, 1); + temp = g_slice_new (GdkRegion); temp->rects = g_new (GdkRegionBox, 1); temp->numRects = 1; @@ -171,7 +171,7 @@ gdk_region_copy (GdkRegion *region) g_return_val_if_fail (region != NULL, NULL); - temp = g_new (GdkRegion, 1); + temp = g_slice_new (GdkRegion); temp->rects = g_new (GdkRegionBox, region->numRects); temp->numRects = region->numRects; @@ -330,7 +330,7 @@ gdk_region_destroy (GdkRegion *r) g_return_if_fail (r != NULL); g_free (r->rects); - g_free (r); + g_slice_free (GdkRegion, r); } |