+static inline void append_report (GString **report, const gchar *format, ...)
+{
+ va_list ap;
+ if (!*report)
+ *report = g_string_new ("");
+
+ va_start (ap, format);
+ g_string_append_vprintf (*report, format, ap);
+ va_end (ap);
+}
+
+static inline void do_mono_profiler_iomap (GString **report, const char *pathname, const char *new_pathname)
+{
+ char *rep = NULL;
+ GString *tmp = report ? *report : NULL;
+
+ if (tmp) {
+ if (tmp->len > 0)
+ rep = g_string_free (tmp, FALSE);
+ else
+ g_string_free (tmp, TRUE);
+ *report = NULL;
+ }
+
+ mono_profiler_iomap (rep, pathname, new_pathname);
+ g_free (rep);
+}
+