Matt McCutchen's Web Site
/
rsync
/
rsync-patches.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed failing hunks.
[rsync/rsync-patches.git]
/
dynamic_hash.diff
diff --git
a/dynamic_hash.diff
b/dynamic_hash.diff
index
0480785
..
4294ae3
100644
(file)
--- a/
dynamic_hash.diff
+++ b/
dynamic_hash.diff
@@
-43,8
+43,8
@@
To use this patch, run these commands for a successful build:
- if (!hash_table) {
- hash_table = new_array(int32, TABLESIZE);
+ /* Dynamically calculate the hash table size so that the hash load
- if (!hash_table) {
- hash_table = new_array(int32, TABLESIZE);
+ /* Dynamically calculate the hash table size so that the hash load
-+ * for big files is about 80%.
This number must be odd or s2 wil
l
-+ * not be able to span the entire set. */
++ * for big files is about 80%.
A number greater than the traditiona
l
++ *
size must be odd or s2 will
not be able to span the entire set. */
+ tablesize = (uint32)(s->count/8) * 10 + 11;
+ if (tablesize < TRADITIONAL_TABLESIZE)
+ tablesize = TRADITIONAL_TABLESIZE;
+ tablesize = (uint32)(s->count/8) * 10 + 11;
+ if (tablesize < TRADITIONAL_TABLESIZE)
+ tablesize = TRADITIONAL_TABLESIZE;
@@
-101,13
+101,16
@@
To use this patch, run these commands for a successful build:
char sum2[SUM_LENGTH];
uint32 s1, s2, sum;
int more;
char sum2[SUM_LENGTH];
uint32 s1, s2, sum;
int more;
-@@ -169,2
1
+180,21 @@ static void hash_search(int f,struct sum
+@@ -169,2
4
+180,21 @@ static void hash_search(int f,struct sum
int done_csum2 = 0;
int32 i;
- if (offset >= reset) {
- sum_pos = build_hash_table(s, sum_pos);
int done_csum2 = 0;
int32 i;
- if (offset >= reset) {
- sum_pos = build_hash_table(s, sum_pos);
-- reset = sum_pos * s->blength;
+- if (sum_pos == s->count)
+- reset = len;
+- else
+- reset = sum_pos * s->blength;
- }
-
if (verbose > 4) {
- }
-
if (verbose > 4) {
@@
-132,7
+135,7
@@
To use this patch, run these commands for a successful build:
hash_hits++;
do {
int32 l;
hash_hits++;
do {
int32 l;
-@@ -35
1
,6 +362,11 @@ void match_sums(int f, struct sum_struct
+@@ -35
4
,6 +362,11 @@ void match_sums(int f, struct sum_struct
}
if (len > 0 && s->count > 0) {
}
if (len > 0 && s->count > 0) {