changeset 2692:8a1c58fa439d

* src/dlmalloc.cxx (MALLOC_COPY): Reinstate fix of 2008-01-06 (reverting change of 2008-11-03). * cdl/memalloc.cdl (CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_USE_MEMCPY): Make explicit dependency on isoinfra functionality block which includes memmove(), and set default_value accordingly.
author jlarmour
date Fri, 19 Dec 2008 05:49:15 +0000
parents 7b7441a92f97
children 18404b982f99
files packages/services/memalloc/common/current/ChangeLog packages/services/memalloc/common/current/cdl/memalloc.cdl packages/services/memalloc/common/current/src/dlmalloc.cxx
diffstat 3 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/services/memalloc/common/current/ChangeLog
+++ b/packages/services/memalloc/common/current/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-19  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* src/dlmalloc.cxx (MALLOC_COPY): Reinstate fix of 2008-01-06
+	(reverting change of 2008-11-03).
+	* cdl/memalloc.cdl (CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_USE_MEMCPY):
+	Make explicit dependency on isoinfra functionality block which
+	includes memmove(), and set default_value accordingly.
+
 2008-11-03  Nick Garnett  <nickg@ecoscentric.com>
 
 	* src/dlmalloc.cxx (MALLOC_COPY): Replace memmove() with memcpy().
--- a/packages/services/memalloc/common/current/cdl/memalloc.cdl
+++ b/packages/services/memalloc/common/current/cdl/memalloc.cdl
@@ -178,12 +178,15 @@ cdl_package CYGPKG_MEMALLOC {
            cdl_option CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_USE_MEMCPY {
                 display       "Use system memmove() and memset()"
                 requires      CYGPKG_ISOINFRA
-                default_value { 0 != CYGPKG_ISOINFRA }
+                requires      CYGINT_ISO_STRING_MEMFUNCS
+                default_value { (0 != CYGPKG_ISOINFRA) && (0 != CYGINT_ISO_STRING_MEMFUNCS) }
                 description   "
                     This may be used to control whether memset() and memmove()
                     are used within the implementation. The alternative is
-                    to use some macro equivalents, which some people report
-                    are faster in some circumstances."
+                    to use some macro equivalents, which have been reported
+                    to be faster in some circumstances. The use of \"MEMCPY\"
+                    in the CDL option name is an anachronism and only
+                    present for backwards compatibility."
            }
 
            cdl_option CYGNUM_MEMALLOC_ALLOCATOR_DLMALLOC_ALIGNMENT {
--- a/packages/services/memalloc/common/current/src/dlmalloc.cxx
+++ b/packages/services/memalloc/common/current/src/dlmalloc.cxx
@@ -333,7 +333,7 @@ do {                                    
                                      *mcdst++ = *mcsrc++;                     \
                                      *mcdst++ = *mcsrc++;                     \
                                      *mcdst   = *mcsrc  ;                     \
-  } else memcpy(dest, src, mcsz);                                             \
+  } else memmove(dest, src, mcsz);                                            \
 } while(0)
 
 #else /* !CYGIMP_MEMALLOC_ALLOCATOR_DLMALLOC_USE_MEMCPY */