9 #define FUDGE_BUF (100*1024)
16 } spec_fd[MAX_SPEC_FD];
22 /* Allocate some large chunks of memory, we can tune this later */
23 for (i = 0; i < MAX_SPEC_FD; i++) {
24 spec_fd[i].buf = (unsigned char *) malloc(FUDGE_BUF);
29 int spec_load(char *filename, int size) {
30 #define FILE_CHUNK (128*1024)
35 fd = open(filename, O_RDONLY | O_BINARY);
36 rc = read(fd, spec_fd[0].buf, FILE_CHUNK);
38 fprintf(stderr, "Error reading from %s: %s\n", filename,
46 #define MB (1024*1024)
47 int main(int argc, char *argv[]) {
49 char *input_name = "input.combined";
53 spec_load(input_name, input_size * MB);