[Libreoffice-commits] .: patches/dev300
Michael Meeks
mmeeks at kemper.freedesktop.org
Fri Oct 8 08:38:40 PDT 2010
patches/dev300/apply | 2
patches/dev300/valgrind-alloc.diff | 253 -------------------------------------
2 files changed, 255 deletions(-)
New commits:
commit fd1e8e2b2776e3993a232065f299e22c2ef05415
Author: Michael Meeks <michael.meeks at novell.com>
Date: Fri Oct 8 16:37:41 2010 +0100
flatten and merge valgrind helper patch
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 132123a..edd0318 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -782,8 +782,6 @@ writer-default-as-optimal-page-wrap.diff, i#38108, jody
#
# Use the Gnome VFS on KDE as well if it's there (better than nothing)
vfs-kde-too.diff, michael
-# Trade speed for reliability with valgrind
-valgrind-alloc.diff, michael
[ Win32Only ]
# search <ooo-home>/share/template/common for language independent templates
diff --git a/patches/dev300/valgrind-alloc.diff b/patches/dev300/valgrind-alloc.diff
deleted file mode 100644
index 59dbd62..0000000
--- a/patches/dev300/valgrind-alloc.diff
+++ /dev/null
@@ -1,253 +0,0 @@
----
- sal/rtl/source/alloc.c | 158 ++++++++++++++++++++++++++++++++++++++++--------
- 1 files changed, 133 insertions(+), 25 deletions(-)
-
-diff --git sal/rtl/source/alloc.c sal/rtl/source/alloc.c
-index a694c6c..34250e6 100644
---- sal/rtl/source/alloc.c
-+++ sal/rtl/source/alloc.c
-@@ -287,6 +287,39 @@ static sal_Size __rtl_memory_vmpagesize (void)
-
- /*===========================================================================
- *
-+ * Determine allocation mode (debug/release) by examining environment
-+ * variable "OOO_FORCE_SYSALLOC".
-+ *
-+ *=========================================================================*/
-+
-+#include <stdlib.h> /* getenv */
-+#include <stdio.h> /* stderr */
-+
-+typedef
-+ enum { AMode_CUSTOM, AMode_SYSTEM, AMode_UNSET }
-+ AllocMode;
-+
-+static AllocMode alloc_mode = AMode_UNSET;
-+
-+static void determine_alloc_mode ( void )
-+{
-+ /* This shouldn't happen, but still ... */
-+ if (alloc_mode != AMode_UNSET)
-+ return;
-+
-+ if (getenv("OOO_FORCE_SYSALLOC") != NULL) {
-+ alloc_mode = AMode_SYSTEM;
-+ fprintf(stderr, "OOo: Using system memory allocator.\n");
-+ fprintf(stderr, "OOo: This is for debugging only. To disable,\n");
-+ fprintf(stderr, "OOo: unset the environment variable"
-+ " OOO_FORCE_SYSALLOC.\n");
-+ } else {
-+ alloc_mode = AMode_CUSTOM;
-+ }
-+}
-+
-+/*===========================================================================
-+ *
- * rtl_memory (global) internals.
- *
- *=========================================================================*/
-@@ -1233,8 +1266,8 @@ static void __rtl_memory_enqueue (memory_type **ppMemory)
- /*
- * rtl_reallocateMemory.
- */
--#ifndef FORCE_SYSALLOC
--void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+static
-+void* SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- {
- memory_type * memory;
- if (!(!p || !n))
-@@ -1390,18 +1423,33 @@ void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- }
- return (p);
- }
--#else /* FORCE_SYSALLOC */
--void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+
-+static
-+void* SAL_CALL rtl_reallocateMemory_SYSTEM (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- {
- return realloc(p, (sal_Size)(n));
- }
--#endif /* FORCE_SYSALLOC */
-+
-+void* SAL_CALL rtl_reallocateMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+{
-+ while (1) {
-+ if (alloc_mode == AMode_CUSTOM) {
-+ return rtl_reallocateMemory_CUSTOM(p,n);
-+ }
-+ if (alloc_mode == AMode_SYSTEM) {
-+ return rtl_reallocateMemory_SYSTEM(p,n);
-+ }
-+ determine_alloc_mode();
-+ }
-+}
-+
-+
-
- /*
- * rtl_allocateMemory.
- */
--#ifndef FORCE_SYSALLOC
--void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+static
-+void* SAL_CALL rtl_allocateMemory_CUSTOM (sal_Size n) SAL_THROW_EXTERN_C()
- {
- void * p = 0;
- if (n > 0)
-@@ -1423,18 +1471,33 @@ void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
- }
- return (p);
- }
--#else /* FORCE_SYSALLOC */
--void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+
-+static
-+void* SAL_CALL rtl_allocateMemory_SYSTEM (sal_Size n) SAL_THROW_EXTERN_C()
- {
- return malloc((sal_Size)(n));
- }
--#endif /* FORCE_SYSALLOC */
-+
-+void* SAL_CALL rtl_allocateMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+{
-+ while (1) {
-+ if (alloc_mode == AMode_CUSTOM) {
-+ return rtl_allocateMemory_CUSTOM(n);
-+ }
-+ if (alloc_mode == AMode_SYSTEM) {
-+ return rtl_allocateMemory_SYSTEM(n);
-+ }
-+ determine_alloc_mode();
-+ }
-+}
-+
-+
-
- /*
- * rtl_freeMemory.
- */
--#ifndef FORCE_SYSALLOC
--void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
-+static
-+void SAL_CALL rtl_freeMemory_CUSTOM (void * p) SAL_THROW_EXTERN_C()
- {
- if (p)
- {
-@@ -1455,18 +1518,34 @@ void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
- RTL_MEMORY_LEAVE();
- }
- }
--#else /* FORCE_SYSALLOC */
--void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
-+
-+static
-+void SAL_CALL rtl_freeMemory_SYSTEM (void * p) SAL_THROW_EXTERN_C()
- {
- free(p);
- }
--#endif /* FORCE_SYSALLOC */
-+
-+void SAL_CALL rtl_freeMemory (void * p) SAL_THROW_EXTERN_C()
-+{
-+ while (1) {
-+ if (alloc_mode == AMode_CUSTOM) {
-+ rtl_freeMemory_CUSTOM(p);
-+ return;
-+ }
-+ if (alloc_mode == AMode_SYSTEM) {
-+ rtl_freeMemory_SYSTEM(p);
-+ return;
-+ }
-+ determine_alloc_mode();
-+ }
-+}
-+
-
- /*
- * rtl_allocateZeroMemory.
- */
--#ifndef FORCE_SYSALLOC
--void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+static
-+void* SAL_CALL rtl_allocateZeroMemory_CUSTOM (sal_Size n) SAL_THROW_EXTERN_C()
- {
- void * p = 0;
- if (n > 0)
-@@ -1489,18 +1568,32 @@ void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
- }
- return (p);
- }
--#else /* FORCE_SYSALLOC */
--void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+
-+static
-+void* SAL_CALL rtl_allocateZeroMemory_SYSTEM (sal_Size n) SAL_THROW_EXTERN_C()
- {
- return calloc((sal_Size)(n), 1);
- }
--#endif /* FORCE_SYSALLOC */
-+
-+void* SAL_CALL rtl_allocateZeroMemory (sal_Size n) SAL_THROW_EXTERN_C()
-+{
-+ while (1) {
-+ if (alloc_mode == AMode_CUSTOM) {
-+ return rtl_allocateZeroMemory_CUSTOM(n);
-+ }
-+ if (alloc_mode == AMode_SYSTEM) {
-+ return rtl_allocateZeroMemory_SYSTEM(n);
-+ }
-+ determine_alloc_mode();
-+ }
-+}
-+
-
- /*
- * rtl_freeZeroMemory.
- */
--#ifndef FORCE_SYSALLOC
--void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+static
-+void SAL_CALL rtl_freeZeroMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- {
- (void) n; /* unused */
- if (p)
-@@ -1523,8 +1616,9 @@ void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- RTL_MEMORY_LEAVE();
- }
- }
--#else /* FORCE_SYSALLOC */
--void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+
-+static
-+void SAL_CALL rtl_freeZeroMemory_SYSTEM (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- {
- if (p)
- {
-@@ -1532,7 +1626,21 @@ void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
- free(p);
- }
- }
--#endif /* FORCE_SYSALLOC */
-+
-+void SAL_CALL rtl_freeZeroMemory (void * p, sal_Size n) SAL_THROW_EXTERN_C()
-+{
-+ while (1) {
-+ if (alloc_mode == AMode_CUSTOM) {
-+ rtl_freeZeroMemory_CUSTOM(p,n);
-+ return;
-+ }
-+ if (alloc_mode == AMode_SYSTEM) {
-+ rtl_freeZeroMemory_SYSTEM(p,n);
-+ return;
-+ }
-+ determine_alloc_mode();
-+ }
-+}
-
- /*===========================================================================
- *
---
-1.7.0.1
-
More information about the Libreoffice-commits
mailing list