X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-memory.c;h=d59e8f8cdded95ceb3c8f9cffe60476361c02406;hb=04c58b9e5fbdf3acc7565f989e5fcd11f0c23c57;hp=6cf044985406dda7ea15c52ea4af21ff6c9ce8d5;hpb=2b3272c75ae48c93911bd6f656965cf77d6de3e8;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-memory.c b/dbus/dbus-memory.c index 6cf0449..d59e8f8 100644 --- a/dbus/dbus-memory.c +++ b/dbus/dbus-memory.c @@ -97,7 +97,7 @@ * @{ */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS static dbus_bool_t debug_initialized = FALSE; static int fail_nth = -1; static size_t fail_size = 0; @@ -240,7 +240,7 @@ _dbus_get_fail_alloc_failures (void) return n_failures_per_failure; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS /** * Called when about to alloc some memory; if * it returns #TRUE, then the allocation should @@ -294,7 +294,7 @@ _dbus_decrement_fail_alloc_counter (void) return FALSE; } } -#endif /* DBUS_BUILD_TESTS */ +#endif /* DBUS_ENABLE_EMBEDDED_TESTS */ /** * Get the number of outstanding malloc()'d blocks. @@ -460,7 +460,7 @@ set_guards (void *real_block, void* dbus_malloc (size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -472,7 +472,7 @@ dbus_malloc (size_t bytes) if (bytes == 0) /* some system mallocs handle this, some don't */ return NULL; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -499,7 +499,7 @@ dbus_malloc (size_t bytes) void *mem; mem = malloc (bytes); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem) { _dbus_atomic_inc (&n_blocks_outstanding); @@ -530,7 +530,7 @@ dbus_malloc (size_t bytes) void* dbus_malloc0 (size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -543,7 +543,7 @@ dbus_malloc0 (size_t bytes) if (bytes == 0) return NULL; -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -571,7 +571,7 @@ dbus_malloc0 (size_t bytes) void *mem; mem = calloc (bytes, 1); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem) { _dbus_atomic_inc (&n_blocks_outstanding); @@ -601,7 +601,7 @@ void* dbus_realloc (void *memory, size_t bytes) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS _dbus_initialize_malloc_debug (); if (_dbus_decrement_fail_alloc_counter ()) @@ -617,7 +617,7 @@ dbus_realloc (void *memory, dbus_free (memory); return NULL; } -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS else if (fail_size != 0 && bytes > fail_size) return NULL; else if (guards) @@ -677,7 +677,7 @@ dbus_realloc (void *memory, void *mem; mem = realloc (memory, bytes); -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (mem == NULL && malloc_cannot_fail) { _dbus_warn ("out of memory: malloc (%ld)\n", (long) bytes); @@ -700,7 +700,7 @@ dbus_realloc (void *memory, void dbus_free (void *memory) { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS if (guards) { check_guards (memory, TRUE); @@ -724,7 +724,7 @@ dbus_free (void *memory) if (memory) /* we guarantee it's safe to free (NULL) */ { -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #ifdef DBUS_DISABLE_ASSERT _dbus_atomic_dec (&n_blocks_outstanding); #else @@ -912,7 +912,7 @@ dbus_shutdown (void) /** @} */ /** End of public API docs block */ -#ifdef DBUS_BUILD_TESTS +#ifdef DBUS_ENABLE_EMBEDDED_TESTS #include "dbus-test.h" /**