[Libreoffice-commits] .: sal/rtl

Stephan Bergmann sbergmann at kemper.freedesktop.org
Mon Oct 24 15:01:31 PDT 2011


 sal/rtl/source/alloc_arena.c |    2 +-
 sal/rtl/source/alloc_cache.c |    8 ++++----
 sal/rtl/source/alloc_impl.h  |    2 ++
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 0a6132d7de81e33f6d632f621cf30eb232c3b5df
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Oct 25 00:01:01 2011 +0200

    Fix previous commit for non-Valgrind builds.

diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.c
index 3936481..1585273 100644
--- a/sal/rtl/source/alloc_arena.c
+++ b/sal/rtl/source/alloc_arena.c
@@ -1100,7 +1100,7 @@ SAL_CALL rtl_arena_free (
 
                 /* DEBUG ONLY: mark unallocated, undefined */
                 VALGRIND_MEMPOOL_FREE(arena, segment->m_addr);
-                /* OSL_DEBUG_ONLY() */ (void) VALGRIND_MAKE_MEM_UNDEFINED(segment->m_addr, segment->m_size);
+                /* OSL_DEBUG_ONLY() */ RTL_VALGRIND_IGNORE_VAL VALGRIND_MAKE_MEM_UNDEFINED(segment->m_addr, segment->m_size);
                 OSL_DEBUG_ONLY(memset((void*)(segment->m_addr), 0x33333333, segment->m_size));
 
                 /* coalesce w/ adjacent free segment(s) */
diff --git a/sal/rtl/source/alloc_cache.c b/sal/rtl/source/alloc_cache.c
index e4cbc74..1a4c87e 100644
--- a/sal/rtl/source/alloc_cache.c
+++ b/sal/rtl/source/alloc_cache.c
@@ -500,7 +500,7 @@ rtl_cache_slab_alloc (
             addr = bufctl;
 
         /* DEBUG ONLY: mark allocated, undefined */
-        /* OSL_DEBUG_ONLY() */ (void) VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size);
+        /* OSL_DEBUG_ONLY() */ RTL_VALGRIND_IGNORE_VAL VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size);
         OSL_DEBUG_ONLY(memset(addr, 0x77777777, cache->m_type_size));
         VALGRIND_MEMPOOL_ALLOC(cache, addr, cache->m_type_size);
     }
@@ -527,7 +527,7 @@ rtl_cache_slab_free (
 
     /* DEBUG ONLY: mark unallocated, undefined */
     VALGRIND_MEMPOOL_FREE(cache, addr);
-    /* OSL_DEBUG_ONLY() */ (void) VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size);
+    /* OSL_DEBUG_ONLY() */ RTL_VALGRIND_IGNORE_VAL VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size);
     OSL_DEBUG_ONLY(memset(addr, 0x33333333, cache->m_type_size));
 
     /* determine slab from addr */
@@ -641,7 +641,7 @@ rtl_cache_magazine_clear (
         if (cache->m_destructor != 0)
         {
             /* DEBUG ONLY: keep constructed object defined */
-            (void) VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
+            RTL_VALGRIND_IGNORE_VAL VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
 
             /* destruct object */
             (cache->m_destructor)(obj, cache->m_userarg);
@@ -1237,7 +1237,7 @@ SAL_CALL rtl_cache_alloc (
                 if (cache->m_constructor != 0)
                 {
                     /* keep constructed object defined */
-                    (void) VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
+                    RTL_VALGRIND_IGNORE_VAL VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size);
                 }
 #endif /* HAVE_VALGRIND_MEMCHECK_H */
                 cache->m_cpu_stats.m_alloc += 1;
diff --git a/sal/rtl/source/alloc_impl.h b/sal/rtl/source/alloc_impl.h
index 55f6ed3..8ea0384 100644
--- a/sal/rtl/source/alloc_impl.h
+++ b/sal/rtl/source/alloc_impl.h
@@ -258,6 +258,7 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
 #define VALGRIND_DESTROY_MEMPOOL(pool)
 #define VALGRIND_MEMPOOL_ALLOC(pool, addr, size)
 #define VALGRIND_MEMPOOL_FREE(pool, addr)
+#define RTL_VALGRIND_IGNORE_VAL
 #elif defined(HAVE_MEMCHECK_H)
 #include <memcheck.h>
 /* valgrind macros contain unused variables... */
@@ -267,6 +268,7 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
 #if GCC_VERSION >= 40201 && !defined __clang__
 #pragma GCC diagnostic warning "-Wunused-but-set-variable"
 #endif
+#define RTL_VALGRIND_IGNORE_VAL (void)
 #endif /* NVALGRIND || HAVE_MEMCHECK_H */
 
 typedef enum { AMode_CUSTOM, AMode_SYSTEM, AMode_UNSET } AllocMode;


More information about the Libreoffice-commits mailing list