File src/radixsort.c changed (mode: 100644) (index fb11ec8..b8a01dc) |
... |
... |
RadixItem **radixsort_get_slot(RadixSorter *rs, unsigned topIndex) |
48 |
48 |
void radixsort_add(RadixSorter *rs, RadixItem *item) |
void radixsort_add(RadixSorter *rs, RadixItem *item) |
49 |
49 |
{ |
{ |
50 |
50 |
if(item->key > rs->keyLimit) { |
if(item->key > rs->keyLimit) { |
51 |
|
if(RADIX_DEBUG) fprintf(stderr, "ERROR: Radix sort overflow - inserted key is bigger than limit (%i): %i\n", rs->keyLimit, item->key); |
|
|
51 |
|
if(RADIX_DEBUG) fprintf(stderr, "ERROR: Radix sort overflow - inserted key is bigger than limit (%u): %u\n", rs->keyLimit, item->key); |
52 |
52 |
if(rs->optFloorAndInsertBigKeys) { |
if(rs->optFloorAndInsertBigKeys) { |
53 |
|
item->key = rs->keyLimit; |
|
|
53 |
|
item->key = rs->keyLimit-1; |
54 |
54 |
} else { |
} else { |
55 |
55 |
if(rs->optIgnoreBigKeys) { |
if(rs->optIgnoreBigKeys) { |
56 |
56 |
return; |
return; |
File tests/monster/monster-hh-env.sh changed (mode: 100755) (index 051d80c..83bb601) |
1 |
1 |
#!/bin/bash |
#!/bin/bash |
2 |
2 |
|
|
3 |
3 |
export HISTCONTROL=ignorespace |
export HISTCONTROL=ignorespace |
4 |
|
export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_50M |
|
|
4 |
|
export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_same |
|
5 |
|
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_50M |
5 |
6 |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_23M |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_23M |
6 |
7 |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_500k |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history_500k |
7 |
8 |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history |
#export HISTFILE=/home/dvorka/p/hstr/monster/.bash_history |
8 |
9 |
export HISTFILESIZE=10000000 |
export HISTFILESIZE=10000000 |
9 |
10 |
export HISTSIZE=1000000 |
export HISTSIZE=1000000 |
10 |
11 |
|
|
11 |
|
PS1="\$? \$(if [[ \$? == 0 ]]; then echo \"\[\033[0;32m\];)\"; else echo \"\[\033[0;31m\];(\"; fi)\[\033[00m\] : " |
|
12 |
|
|
|
13 |
12 |
# eof |
# eof |
File tests/src/test_ranking.c changed (mode: 100644) (index d055bf4..86815b1) |
... |
... |
void testLog() { |
15 |
15 |
#define MAX_CHARACTER_CODE 10000 |
#define MAX_CHARACTER_CODE 10000 |
16 |
16 |
static char line[MAX_CHARACTER_CODE]; |
static char line[MAX_CHARACTER_CODE]; |
17 |
17 |
|
|
18 |
|
void testGenerateCrazyHistoryFile() |
|
|
18 |
|
void testGenerateHugeHistoryFileWithDifferentLines() |
19 |
19 |
{ |
{ |
20 |
|
FILE *file = fopen(".bash_history_crazy","a"); |
|
|
20 |
|
FILE *file = fopen(".bash_history_huge","a"); |
21 |
21 |
fseek(file,0, SEEK_END); |
fseek(file,0, SEEK_END); |
22 |
22 |
|
|
23 |
23 |
line[0]=0; |
line[0]=0; |
|
... |
... |
void testGenerateCrazyHistoryFile() |
26 |
26 |
sprintf(line,"%s%c",line,i); |
sprintf(line,"%s%c",line,i); |
27 |
27 |
fprintf(file,"%s\n",line); |
fprintf(file,"%s\n",line); |
28 |
28 |
} |
} |
|
29 |
|
fclose(file); |
|
30 |
|
} |
|
31 |
|
|
29 |
32 |
|
|
|
33 |
|
void testGenerateHugeHistoryFileWithSameLines() |
|
34 |
|
{ |
|
35 |
|
FILE *file = fopen(".bash_history_same","a"); |
|
36 |
|
fseek(file,0, SEEK_END); |
|
37 |
|
|
|
38 |
|
int i; |
|
39 |
|
for(i=0; i<100000; i++) { |
|
40 |
|
fprintf(file,"find . | while read X; do echo $X; cat $X | grep -i ctrl; done | less\n",line); |
|
41 |
|
fprintf(file, |
|
42 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
43 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
44 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
45 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
46 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
47 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master#" |
|
48 |
|
"git commit -a -m \"Code review and stabilization.\" && git push origin master\n", |
|
49 |
|
line); |
|
50 |
|
} |
30 |
51 |
fclose(file); |
fclose(file); |
31 |
52 |
} |
} |
32 |
53 |
|
|
|
54 |
|
|
33 |
55 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |
34 |
56 |
{ |
{ |
35 |
|
testGenerateCrazyHistoryFile(); |
|
|
57 |
|
testGenerateHugeHistoryFileWithSameLines(); |
36 |
58 |
} |
} |
37 |
59 |
|
|