summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-25 07:38:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-29 08:08:28 +0100
commit36480fe531f19d9c692ee1f8cf09accd4b2c0ad8 (patch)
treee9c84dd48cfcf98a37d6e5fdb529b37bd4de9ee9 /src/cairo-traps.c
parent9d51c03bad5f10257e248f43375062902482c0c4 (diff)
downloadcairo-36480fe531f19d9c692ee1f8cf09accd4b2c0ad8.tar.gz
[traps] Increase exponential expansion factor.
Grow the traps more rapidly, as the allocations are very short-lived so the over-allocation is less of an issue.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r--src/cairo-traps.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index b9f5ba71b..5f04ce160 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -124,7 +124,7 @@ static cairo_bool_t
_cairo_traps_grow (cairo_traps_t *traps)
{
cairo_trapezoid_t *new_traps;
- int new_size = 2 * MAX (traps->traps_size, 16);
+ int new_size = 4 * traps->traps_size;
if (CAIRO_INJECT_FAULT ()) {
traps->status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -157,10 +157,8 @@ _cairo_traps_add_trap (cairo_traps_t *traps,
{
cairo_trapezoid_t *trap;
- assert (top < bottom);
-
- if (traps->num_traps == traps->traps_size) {
- if (! _cairo_traps_grow (traps))
+ if (unlikely (traps->num_traps == traps->traps_size)) {
+ if (unlikely (! _cairo_traps_grow (traps)))
return;
}