diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-04-16 17:19:12 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-04-23 09:22:51 +0100 |
commit | 1ae2ddc1dd4c90d50b8c57c4de677f8ab96b1fa2 (patch) | |
tree | 3be2da997e6f7da5df94472e0c700bb5abe00086 /src/cairo-hull.c | |
parent | 817589e1967ebdd5e5bda1781eb76010fd8c37dc (diff) | |
download | cairo-1ae2ddc1dd4c90d50b8c57c4de677f8ab96b1fa2.tar.gz |
[memfault] Manually inject faults when using stack allocations
Ensure that no assumptions are made that a small allocation will succeed
by manually injecting faults when we may be simply allocating from an
embedded memory pool.
The main advantage in manual fault injection is improved code coverage -
from within the test suite most allocations are handled by the embedded
memory pools.
Diffstat (limited to 'src/cairo-hull.c')
-rw-r--r-- | src/cairo-hull.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cairo-hull.c b/src/cairo-hull.c index a699a524b..1fa919bf3 100644 --- a/src/cairo-hull.c +++ b/src/cairo-hull.c @@ -198,6 +198,9 @@ _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices) cairo_hull_t *hull; int num_hull = *num_vertices; + if (CAIRO_INJECT_FAULT ()) + return _cairo_error (CAIRO_STATUS_NO_MEMORY); + if (num_hull > ARRAY_LENGTH (hull_stack)) { hull = _cairo_malloc_ab (num_hull, sizeof (cairo_hull_t)); if (unlikely (hull == NULL)) |