[Libreoffice-commits] .: sal/rtl

2012-04-02 Thread Michael Meeks
 sal/rtl/source/uri.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 54bc03051702ad279dfd17471a3d5c30003c892d
Author: Michael Meeks michael.me...@suse.com
Date:   Mon Apr 2 14:26:43 2012 +0100

sal: reduce allocation thrash in URI encode / decode

This saves 1% of string allocation / destruction on startup.

diff --git a/sal/rtl/source/uri.cxx b/sal/rtl/source/uri.cxx
index 5febefd..3945e04 100644
--- a/sal/rtl/source/uri.cxx
+++ b/sal/rtl/source/uri.cxx
@@ -609,8 +609,8 @@ void SAL_CALL rtl_uriEncode(rtl_uString * pText, sal_Bool 
const * pCharClass,
 
 sal_Unicode const * p = pText-buffer;
 sal_Unicode const * pEnd = p + pText-length;
-sal_Int32 nCapacity = 0;
-rtl_uString_new(pResult);
+sal_Int32 nCapacity = pText-length;
+rtl_uString_new_WithLength(pResult, nCapacity);
 while (p  pEnd)
 {
 EscapeType eType;
@@ -676,8 +676,8 @@ void SAL_CALL rtl_uriDecode(rtl_uString * pText,
 {
 sal_Unicode const * p = pText-buffer;
 sal_Unicode const * pEnd = p + pText-length;
-sal_Int32 nCapacity = 0;
-rtl_uString_new(pResult);
+sal_Int32 nCapacity = pText-length;
+rtl_uString_new_WithLength(pResult, nCapacity);
 while (p  pEnd)
 {
 EscapeType eType;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/rtl

2012-03-30 Thread Michael Meeks
 sal/rtl/source/strtmpl.cxx |   46 -
 sal/rtl/source/ustring.cxx |   18 +
 2 files changed, 51 insertions(+), 13 deletions(-)

New commits:
commit 81a4e4ba99b1534949e66bf81c723c2123fd47f0
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Mar 30 15:14:10 2012 +0100

sal: add a more permanant set of annotations for lifetime tracking.

Having done this on a temporary basis a couple of times before,
it'd be good to avoid having to do the instrumentation again.

diff --git a/sal/rtl/source/strtmpl.cxx b/sal/rtl/source/strtmpl.cxx
index 2d8c44b..026d647 100644
--- a/sal/rtl/source/strtmpl.cxx
+++ b/sal/rtl/source/strtmpl.cxx
@@ -49,6 +49,12 @@ inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest,
 }
 */
 
+// for instrumentation / diagnostics
+#ifndef RTL_LOG_STRING_NEW
+#  define RTL_LOG_STRING_NEW(s)
+#  define RTL_LOG_STRING_DELETE(s)
+#endif
+
 #define rtl_str_ImplCopy( _pDest, _pSrc, _nCount )  \
 {   \
 IMPL_RTL_STRCODE*   __mm_pDest  = _pDest;   \
@@ -1014,6 +1020,8 @@ static IMPL_RTL_STRCODE* IMPL_RTL_STRINGNAME( ImplNewCopy 
)( IMPL_RTL_STRINGDATA
 }
 
 *ppThis = pData;
+
+RTL_LOG_STRING_NEW( pData );
 return pDest;
 }
 
@@ -1055,6 +1063,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( 
IMPL_RTL_STRINGDATA* pThis )
 if ( pThis-refCount == 1 ||
  !osl_decrementInterlockedCount( (pThis-refCount) ) )
 {
+RTL_LOG_STRING_DELETE( pThis );
 rtl_freeMemory( pThis );
 }
 }
@@ -1112,8 +1121,9 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromString )( 
IMPL_RTL_STRINGDATA** ppThis
 *ppThis = IMPL_RTL_STRINGNAME( ImplAlloc )( pStr-length );
 OSL_ASSERT(*ppThis != NULL);
 rtl_str_ImplCopy( (*ppThis)-buffer, pStr-buffer, pStr-length );
+RTL_LOG_STRING_NEW( *ppThis );
 
-/* must be done at least, if pStr == *ppThis */
+/* must be done last, if pStr == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
 }
@@ -1156,7 +1166,9 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr )( 
IMPL_RTL_STRINGDATA** ppThis,
 }
 while ( *pCharStr );
 
-/* must be done at least, if pCharStr == *ppThis */
+RTL_LOG_STRING_NEW( *ppThis );
+
+/* must be done last, if pCharStr == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
 }
@@ -1181,7 +1193,9 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr_WithLength 
)( IMPL_RTL_STRINGDATA*
 OSL_ASSERT(*ppThis != NULL);
 rtl_str_ImplCopy( (*ppThis)-buffer, pCharStr, nLen );
 
-/* must be done at least, if pCharStr == *ppThis */
+RTL_LOG_STRING_NEW( *ppThis );
+
+/* must be done last, if pCharStr == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
 }
@@ -1220,6 +1234,8 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromLiteral)( 
IMPL_RTL_STRINGDATA** ppThis
 pCharStr++;
 }
 }
+
+RTL_LOG_STRING_NEW( *ppThis );
 }
 
 /* --- */
@@ -1280,9 +1296,11 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newConcat )( 
IMPL_RTL_STRINGDATA** ppThis,
 rtl_str_ImplCopy( pTempStr-buffer, pLeft-buffer, pLeft-length );
 rtl_str_ImplCopy( pTempStr-buffer+pLeft-length, pRight-buffer, 
pRight-length );
 *ppThis = pTempStr;
+
+RTL_LOG_STRING_NEW( *ppThis );
 }
 
-/* must be done at least, if left or right == *ppThis */
+/* must be done last, if left or right == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
 }
@@ -1334,7 +1352,6 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplaceStrAt )( 
IMPL_RTL_STRINGDATA** ppTh
 return;
 }
 
-{
 IMPL_RTL_STRINGDATA*pOrg = *ppThis;
 IMPL_RTL_STRCODE*   pBuffer;
 sal_Int32   nNewLen;
@@ -1360,10 +1377,10 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplaceStrAt )( 
IMPL_RTL_STRINGDATA** ppTh
 }
 rtl_str_ImplCopy( pBuffer, pStr-buffer+nIndex+nCount, 
pStr-length-nIndex-nCount );
 
-/* must be done at least, if pStr or pNewSubStr == *ppThis */
+RTL_LOG_STRING_NEW( *ppThis );
+/* must be done last, if pStr or pNewSubStr == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
-}
 }
 
 /* --- */
@@ -1421,7 +1438,8 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplace )( 
IMPL_RTL_STRINGDATA** ppThis,
 IMPL_RTL_AQUIRE( pStr );
 }
 
-/* must be done at least, if pStr == *ppThis */
+RTL_LOG_STRING_NEW( *ppThis );
+/* must be done last, if pStr == *ppThis */
 if ( pOrg )
 IMPL_RTL_STRINGNAME( release )( pOrg );
 }
@@ -1482,7 +1500,8 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( 
IMPL_RTL_STRINGDATA**
 IMPL_RTL_AQUIRE( pStr );
 }
 
-/* must be done at 

[Libreoffice-commits] .: sal/rtl

2011-12-19 Thread Matus Kukan
 sal/rtl/source/alloc_impl.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec64e5e36db7d9bf7c9f6fe2705c11dc54548fb7
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Mon Dec 19 12:09:48 2011 +0100

WaE: GCC 4.5.1 does not allow #pragma GCC diagnostic warning

diff --git a/sal/rtl/source/alloc_impl.hxx b/sal/rtl/source/alloc_impl.hxx
index 2e51abe..4452f19 100644
--- a/sal/rtl/source/alloc_impl.hxx
+++ b/sal/rtl/source/alloc_impl.hxx
@@ -260,7 +260,7 @@ typedef CRITICAL_SECTION rtl_memory_lock_type;
 #define GCC_VERSION (__GNUC__ * 1 \
  + __GNUC_MINOR__ * 100 \
  + __GNUC_PATCHLEVEL__)
-#if GCC_VERSION = 40201  !defined __clang__
+#if GCC_VERSION = 40600  !defined __clang__
 #pragma GCC diagnostic warning -Wunused-but-set-variable
 #endif
 #define RTL_VALGRIND_IGNORE_VAL (void)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/rtl

2011-12-13 Thread Caolán McNamara
 sal/rtl/source/alloc_global.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit edf90c212d8bfe6360a1e35eb4d7fbbf82ed33b4
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 13 14:53:41 2011 +

warn about massive allocs

diff --git a/sal/rtl/source/alloc_global.cxx b/sal/rtl/source/alloc_global.cxx
index 6cf7509..59213a1 100644
--- a/sal/rtl/source/alloc_global.cxx
+++ b/sal/rtl/source/alloc_global.cxx
@@ -28,6 +28,7 @@
 
 #include alloc_impl.hxx
 #include rtl/alloc.h
+#include sal/log.hxx
 #include sal/macros.h
 
 #include cassert
@@ -295,6 +296,9 @@ void * SAL_CALL rtl_reallocateMemory_SYSTEM (void * p, 
sal_Size n)
 
 void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
 {
+SAL_WARN_IF(
+n = SAL_MAX_INT32, sal,
+suspicious massive alloc   n);
 #if !defined(FORCE_SYSALLOC)
 while (1)
 {
@@ -315,6 +319,9 @@ void* SAL_CALL rtl_allocateMemory (sal_Size n) 
SAL_THROW_EXTERN_C()
 
 void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
 {
+SAL_WARN_IF(
+n = SAL_MAX_INT32, sal,
+suspicious massive alloc   n);
 #if !defined(FORCE_SYSALLOC)
 while (1)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/rtl

2011-11-30 Thread Stephan Bergmann
 sal/rtl/source/alloc_arena.cxx  |  162 ++
 sal/rtl/source/alloc_cache.cxx  |  214 ++--
 sal/rtl/source/alloc_global.cxx |   14 +-
 3 files changed, 182 insertions(+), 208 deletions(-)

New commits:
commit 2d9beb7854bdfa6e6140e78ab754414340725e38
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Nov 30 10:27:23 2011 +0100

OSL_TRACE in sal/rtl/source/alloc_*.cxx leads to deadlock...

...with SAL_LOG=+INFO due to std::ostringstream in log.cxx using global 
operator
new, which potentially calls rtl_allocateMemory.

diff --git a/sal/rtl/source/alloc_arena.cxx b/sal/rtl/source/alloc_arena.cxx
index 03c7f47..e101310 100644
--- a/sal/rtl/source/alloc_arena.cxx
+++ b/sal/rtl/source/alloc_arena.cxx
@@ -34,6 +34,7 @@
 #include sal/macros.h
 #include osl/diagnose.h
 
+#include cassert
 #include string.h
 #include stdio.h
 
@@ -118,14 +119,11 @@ rtl_arena_segment_constructor (void * obj)
 static void
 rtl_arena_segment_destructor (void * obj)
 {
-#if OSL_DEBUG_LEVEL == 0
-(void) obj; /* unused */
-#else /* OSL_DEBUG_LEVEL */
-rtl_arena_segment_type * segment = (rtl_arena_segment_type*)(obj);
-
-OSL_ASSERT(QUEUE_STARTED_NAMED(segment, s));
-OSL_ASSERT(QUEUE_STARTED_NAMED(segment, f));
-#endif /* OSL_DEBUG_LEVEL */
+rtl_arena_segment_type * segment = static_cast rtl_arena_segment_type * (
+obj);
+assert(QUEUE_STARTED_NAMED(segment, s));
+assert(QUEUE_STARTED_NAMED(segment, f));
+(void) segment; // avoid warnings
 }
 
 /* = */
@@ -184,7 +182,7 @@ rtl_arena_segment_get (
 {
 rtl_arena_segment_type * head;
 
-OSL_ASSERT(*ppSegment == 0);
+assert(*ppSegment == 0);
 
 head = (arena-m_segment_reserve_head);
 if ((head-m_snext != head) || rtl_arena_segment_populate (arena))
@@ -212,13 +210,13 @@ rtl_arena_segment_put (
 {
 rtl_arena_segment_type * head;
 
-OSL_ASSERT(QUEUE_STARTED_NAMED((*ppSegment), s));
-OSL_ASSERT(QUEUE_STARTED_NAMED((*ppSegment), f));
+assert(QUEUE_STARTED_NAMED((*ppSegment), s));
+assert(QUEUE_STARTED_NAMED((*ppSegment), f));
 
 (*ppSegment)-m_addr = 0;
 (*ppSegment)-m_size = 0;
 
-OSL_ASSERT((*ppSegment)-m_type != RTL_ARENA_SEGMENT_TYPE_HEAD);
+assert((*ppSegment)-m_type != RTL_ARENA_SEGMENT_TYPE_HEAD);
 (*ppSegment)-m_type = 0;
 
 /* keep as reserve */
@@ -274,7 +272,7 @@ rtl_arena_freelist_remove (
 rtl_arena_segment_type * head;
 
 head = segment-m_fprev;
-OSL_ASSERT(arena-m_freelist_bitmap  head-m_size);
+assert(arena-m_freelist_bitmap  head-m_size);
 arena-m_freelist_bitmap ^= head-m_size;
 }
 QUEUE_REMOVE_NAMED(segment, f);
@@ -323,16 +321,14 @@ rtl_arena_hash_rescale (
 old_table = arena-m_hash_table;
 old_size  = arena-m_hash_size;
 
-OSL_TRACE(
-rtl_arena_hash_rescale(\%s\): 
-nseg: %PRIu64 (ave: %PRIu64), frees: %PRIu64 
-[old_size: %lu, new_size: %lu],
-arena-m_name,
-arena-m_stats.m_alloc - arena-m_stats.m_free,
-(arena-m_stats.m_alloc - arena-m_stats.m_free)  
arena-m_hash_shift,
-arena-m_stats.m_free,
-old_size, new_size
-);
+// SAL_INFO(
+//  sal,
+//  rtl_arena_hash_rescale(  arena-m_name  ): nseg: 
+//   (arena-m_stats.m_alloc - arena-m_stats.m_free)   (ave: 

+//   ((arena-m_stats.m_alloc - arena-m_stats.m_free)
+//   arena-m_hash_shift)
+//   ), frees:   arena-m_stats.m_free   [old_size: 
+//   old_size  , new_size:   new_size  ']');
 
 arena-m_hash_table = new_table;
 arena-m_hash_size  = new_size;
@@ -404,10 +400,6 @@ rtl_arena_hash_remove (
 rtl_arena_segment_type *segment, **segpp;
 sal_Size lookups = 0;
 
-#if OSL_DEBUG_LEVEL == 0
-(void) size; /* unused */
-#endif /* OSL_DEBUG_LEVEL */
-
 segpp = (arena-m_hash_table[RTL_ARENA_HASH_INDEX(arena, addr)]);
 while ((segment = *segpp) != 0)
 {
@@ -422,10 +414,11 @@ rtl_arena_hash_remove (
 segpp = (segment-m_fnext);
 }
 
-OSL_POSTCOND(segment != 0, rtl_arena_hash_remove(): bad free.);
+assert(segment != 0); // bad free
 if (segment != 0)
 {
-OSL_POSTCOND(segment-m_size == size, rtl_arena_hash_remove(): wrong 
size.);
+assert(segment-m_size == size);
+(void) size; // avoid warnings
 
 arena-m_stats.m_free  += 1;
 arena-m_stats.m_mem_alloc -= segment-m_size;
@@ -470,7 +463,7 @@ rtl_arena_segment_alloc (
 {
 int index = 0;
 
-OSL_ASSERT(*ppSegment == 0);
+assert(*ppSegment == 0);
 if (!RTL_MEMORY_ISP2(size))
 {
 int msb = highbit(size);
@@ -504,7 +497,7 @@ rtl_arena_segment_alloc (
 
 head = (arena-m_freelist_head[index - 1]);
 (*ppSegment) = head-m_fnext;
-

[Libreoffice-commits] .: sal/rtl

2011-11-22 Thread Stephan Bergmann
 sal/rtl/source/makefile.mk |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 171855c21eeedca46fe0cf2ce4f566957e618a45
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 22 11:01:06 2011 +0100

rtlbootstrap.mk.cxx needs to be a C++ file (including C++ macros.hxx).

diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk
index 07c36d3..ff8ee91 100644
--- a/sal/rtl/source/makefile.mk
+++ b/sal/rtl/source/makefile.mk
@@ -159,5 +159,5 @@ $(ALWAYSDBGFILES):
 ALLTAR : $(BOOTSTRAPMK)
 
 $(BOOTSTRAPMK) :
-(echo '#include macro.hxx'; echo RTL_OS:=THIS_OS; echo 
RTL_ARCH:=THIS_ARCH) $(BOOTSTRAPMK).c
-$(CC) -E $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) 
$(CDEFSOBJ) $(CFLAGSAPPEND) $(BOOTSTRAPMK).c | $(GREP) '^RTL_' | $(SED) -e 
's///g' $@
+(echo '#include macro.hxx'; echo RTL_OS:=THIS_OS; echo 
RTL_ARCH:=THIS_ARCH) $(BOOTSTRAPMK).cxx
+$(CXX) -E $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) 
$(CDEFSOBJ) $(CFLAGSAPPEND) $(BOOTSTRAPMK).cxx | $(GREP) '^RTL_' | $(SED) -e 
's///g' $@
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/rtl

2011-10-24 Thread Stephan Bergmann
 sal/rtl/source/alloc_arena.c |2 +-
 sal/rtl/source/alloc_cache.c |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 041b54fef20668abaab5bcc7b52dfc31695c25d2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Oct 24 23:41:21 2011 +0200

Avoid Clang -Wunused-value with trunk rev. 12226 Valgrind.

diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.c
index 5984f75..3936481 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() */ 
VALGRIND_MAKE_MEM_UNDEFINED(segment-m_addr, segment-m_size);
+/* OSL_DEBUG_ONLY() */ (void) 
VALGRIND_MAKE_MEM_UNDEFINED(segment-m_addr, segment-m_size);
 OSL_DEBUG_ONLY(memset((void*)(segment-m_addr), 0x, 
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 4fa16f4..e4cbc74 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() */ VALGRIND_MAKE_MEM_UNDEFINED(addr, 
cache-m_type_size);
+/* OSL_DEBUG_ONLY() */ (void) VALGRIND_MAKE_MEM_UNDEFINED(addr, 
cache-m_type_size);
 OSL_DEBUG_ONLY(memset(addr, 0x, 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() */ VALGRIND_MAKE_MEM_UNDEFINED(addr, 
cache-m_type_size);
+/* OSL_DEBUG_ONLY() */ (void) VALGRIND_MAKE_MEM_UNDEFINED(addr, 
cache-m_type_size);
 OSL_DEBUG_ONLY(memset(addr, 0x, 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 */
-VALGRIND_MAKE_MEM_DEFINED(obj, cache-m_type_size);
+(void) 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 */
-VALGRIND_MAKE_MEM_DEFINED(obj, cache-m_type_size);
+(void) VALGRIND_MAKE_MEM_DEFINED(obj, cache-m_type_size);
 }
 #endif /* HAVE_VALGRIND_MEMCHECK_H */
 cache-m_cpu_stats.m_alloc += 1;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sal/rtl

2011-10-24 Thread Stephan Bergmann
 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 sberg...@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), 0x, 
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, 0x, 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, 0x, 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;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits