You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/05/13 06:58:41 UTC

svn commit: r1679141 - /subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c

Author: stefan2
Date: Wed May 13 04:58:40 2015
New Revision: 1679141

URL: http://svn.apache.org/r1679141
Log:
On the 1.10-cache-improvements branch:
Replicate the effect of r1678950 and r1678963. 

* subversion/libsvn_subr/cache-membuffer.c
  (combine_key): Use memcpy instead of a potentially misaligned read.
                 Having hard-coded copy sizes allows the compiler to
                 optimize the code to something equivalent to what we
                 had so far - if the platform supports unaligned reads.

Modified:
    subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c

Modified: subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c?rev=1679141&r1=1679140&r2=1679141&view=diff
==============================================================================
--- subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c (original)
+++ subversion/branches/1.10-cache-improvements/subversion/libsvn_subr/cache-membuffer.c Wed May 13 04:58:40 2015
@@ -2851,12 +2851,11 @@ combine_key(svn_membuffer_cache_t *cache
   /* short, fixed-size keys are the most common case */
   if (key_len == 16)
     {
-      data[0] = ((const apr_uint64_t *)key)[0];
-      data[1] = ((const apr_uint64_t *)key)[1];
+      memcpy(data, key, 16);
     }
   else if (key_len == 8)
     {
-      data[0] = ((const apr_uint64_t *)key)[0];
+      memcpy(data, key, 8);
       data[1] = 0;
     }
   else