[cfe-commits] [patch] change libc++'s string hash function to cityhash64

Howard Hinnant hhinnant at apple.com
Fri Dec 9 17:07:10 PST 2011


On Dec 9, 2011, at 7:50 PM, Howard Hinnant wrote:

> On Dec 9, 2011, at 7:17 PM, Craig Silverstein wrote:
> 
>> craig
>> Index: include/memory
> 
> I'm drawing a blank.
> 
> $ patch  -p0 < /Users/hhinnant/Desktop/temp.patch 
> patching file include/memory
> patch: **** malformed patch at line 7: template <class _Tp> struct hash;
> 
> Anyone have a clue as to why the enclosed temp.patch is malformed?
> 
> Howard
> <temp.patch>_______________________________________________

More info.  I manually inserted the first 3 comments and got this patch file with svn diff:

Index: include/memory
===================================================================
--- include/memory	(revision 146300)
+++ include/memory	(working copy)
@@ -2719,6 +2719,9 @@
 
 template <class _Tp> struct hash;
 
+// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
+// is 64 bits.  This is because cityhash64 uses 64bit x 64bit
+// multiplication, which can be very slow on 32-bit systems.
 template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
 struct __murmur2;
 

And it worked perfectly as a patch file.

I am not a knowledgable person about svn/diff/patch

Howard




More information about the cfe-commits mailing list