summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-internals.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-02-14 04:54:55 +0000
committerHavoc Pennington <hp@redhat.com>2003-02-14 04:54:55 +0000
commit07a795f1db3b09beeec647643a4f263f617bc371 (patch)
tree4f557fce8ee2012dc7fcd40587d8d40b20d112e3 /dbus/dbus-internals.h
parentb544e59358251f0811c9fe35c149a67d5deafdba (diff)
2003-02-14 Havoc Pennington <hp@pobox.com>
* dbus/dbus-mempool.c: fail if the debug functions so indicate * dbus/dbus-memory.c: fail if the debug functions indicate we should * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter) (_dbus_decrement_fail_alloc_counter): debug functions to simulate memory allocation failures
Diffstat (limited to 'dbus/dbus-internals.h')
-rw-r--r--dbus/dbus-internals.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/dbus/dbus-internals.h b/dbus/dbus-internals.h
index f0baf46b..29dd41ce 100644
--- a/dbus/dbus-internals.h
+++ b/dbus/dbus-internals.h
@@ -142,6 +142,17 @@ void _dbus_verbose_bytes_of_string (const DBusString *str,
const char* _dbus_type_to_string (int type);
+#ifdef DBUS_BUILD_TESTS
+/* Memory debugging */
+void _dbus_set_fail_alloc_counter (int until_next_fail);
+int _dbus_get_fail_alloc_counter (void);
+dbus_bool_t _dbus_decrement_fail_alloc_counter (void);
+#else
+#define _dbus_set_fail_alloc_counter(n)
+#define _dbus_get_fail_alloc_counter _DBUS_INT_MAX
+#define _dbus_decrement_fail_alloc_counter FALSE
+#endif /* !DBUS_BUILD_TESTS */
+
DBUS_END_DECLS;
#endif /* DBUS_INTERNALS_H */