Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade LEN_MAX up to 512 for all combinators by default #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
##

DEBUG := 0

CFLAGS += -Wall -W -pipe -std=gnu99
LEN_MAX=512
CFLAGS += -Wall -W -pipe -std=gnu99 -DLEN_MAX=$(LEN_MAX)

ifeq ($(DEBUG),0)
CFLAGS += -O2
Expand Down
6 changes: 2 additions & 4 deletions src/combinator.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
#include <fcntl.h>
#include "utils.c"

#define LEN_MAX 32

#define SEGMENT_SIZE (32 * 1024 * 1024)
#define SEGMENT_ALIGN ( 8 * 1024)
#define SEGMENT_SIZE (LEN_MAX * 1024 * 1024)
#define SEGMENT_ALIGN (8 * 1024)

/**
* Name........: combinator
Expand Down
6 changes: 2 additions & 4 deletions src/combinator3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
#include <fcntl.h>
#include "utils.c"

#define LEN_MAX 32

#define SEGMENT_SIZE (32 * 1024 * 1024)
#define SEGMENT_ALIGN ( 8 * 1024)
#define SEGMENT_SIZE (LEN_MAX * 1024 * 1024)
#define SEGMENT_ALIGN (8 * 1024)

/**
* Name........: combinator3
Expand Down
20 changes: 10 additions & 10 deletions src/combinatorX.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#define PROG_VERSION "1.2"
#define PROG_RELEASE_DATE "Wed Aug 25 19:42:17 CEST 2021"

#define WORD_MAX_LEN 64
#define SEGMENT_SIZE (WORD_MAX_LEN * 1024 * 1024)
#define MAX_LEN 64
#define SEGMENT_SIZE (MAX_LEN * 1024 * 1024)
#define SEGMENT_ALIGN (8 * 1024)

// lightweight dolphin macro
Expand Down Expand Up @@ -1267,7 +1267,7 @@ int main (int argc, char *argv[])
vir_in[0]--;
}

if (vir_in[0] > WORD_MAX_LEN) continue;
if (vir_in[0] > MAX_LEN) continue;
if (maxLen_isSet && vir_in[0] > main_ctx.maxLen) continue;

// restore 1 if needed
Expand Down Expand Up @@ -1296,7 +1296,7 @@ int main (int argc, char *argv[])
vir_in[1]--;
}

if (vir_in[1] > WORD_MAX_LEN) continue;
if (vir_in[1] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]) > main_ctx.maxLen) continue;

// restore 2 if needed
Expand Down Expand Up @@ -1336,7 +1336,7 @@ int main (int argc, char *argv[])
vir_in[2]--;
}

if (vir_in[2] > WORD_MAX_LEN) continue;
if (vir_in[2] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]) > main_ctx.maxLen) continue;

// restore 3 if needed
Expand Down Expand Up @@ -1377,7 +1377,7 @@ int main (int argc, char *argv[])
vir_in[3]--;
}

if (vir_in[3] > WORD_MAX_LEN) continue;
if (vir_in[3] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]) > main_ctx.maxLen) continue;

// restore 4 if needed
Expand Down Expand Up @@ -1419,7 +1419,7 @@ int main (int argc, char *argv[])
vir_in[4]--;
}

if (vir_in[4] > WORD_MAX_LEN) continue;
if (vir_in[4] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]) > main_ctx.maxLen) continue;

// restore 5 if needed
Expand Down Expand Up @@ -1462,7 +1462,7 @@ int main (int argc, char *argv[])
vir_in[5]--;
}

if (vir_in[5] > WORD_MAX_LEN) continue;
if (vir_in[5] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]) > main_ctx.maxLen) continue;

// restore 6 if needed
Expand Down Expand Up @@ -1506,7 +1506,7 @@ int main (int argc, char *argv[])
vir_in[6]--;
}

if (vir_in[6] > WORD_MAX_LEN) continue;
if (vir_in[6] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]+vir_in[6]) > main_ctx.maxLen) continue;

// restore 7 if needed
Expand Down Expand Up @@ -1551,7 +1551,7 @@ int main (int argc, char *argv[])
vir_in[7]--;
}

if (vir_in[7] > WORD_MAX_LEN) continue;
if (vir_in[7] > MAX_LEN) continue;
if (maxLen_isSet && (vir_in[0]+vir_in[1]+vir_in[2]+vir_in[3]+vir_in[4]+vir_in[5]+vir_in[6]+vir_in[7]) > main_ctx.maxLen) continue;

// restore 8 if needed
Expand Down