summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate-system.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-02 13:08:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-02 15:13:47 +0100
commit7ed050fd435f17d25c7b757b02cfe200f8779fc2 (patch)
treed47e21dd695950f91231786ab3329b98f02d4273 /boilerplate/cairo-boilerplate-system.c
parent403f780b292762aa45056c2fb5a48bb806521173 (diff)
downloadcairo-7ed050fd435f17d25c7b757b02cfe200f8779fc2.tar.gz
[perf] Benchmark traces
Add a variant of cairo-perf that measures the time to replay traces.
Diffstat (limited to 'boilerplate/cairo-boilerplate-system.c')
-rw-r--r--boilerplate/cairo-boilerplate-system.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate-system.c b/boilerplate/cairo-boilerplate-system.c
index 3855b73e6..f13bd146a 100644
--- a/boilerplate/cairo-boilerplate-system.c
+++ b/boilerplate/cairo-boilerplate-system.c
@@ -145,3 +145,18 @@ xunlink (const char *pathname)
exit (1);
}
}
+
+char *
+xstrdup (const char *str)
+{
+ if (str == NULL)
+ return NULL;
+
+ str = strdup (str);
+ if (str == NULL) {
+ fprintf (stderr, "Error: Out of memory. Exiting.\n");
+ exit (1);
+ }
+
+ return (char *) str;
+}