18 int i
= 0; struct list
* last
;
19 int num
= atoi("8000000");
22 int totColumns
= 10000;
23 int currentColumn
= 0;
25 /* Initialize initial list of revisions */
26 struct list
* revisionList
= malloc(size
* sizeof(struct list
));
27 struct hash
* columns
= malloc(totColumns
* sizeof(struct hash
));
29 struct hash standardColumn
;
30 strcpy(standardColumn
.value
, "Haha pieter");
31 for (i
= 0; i
< num
; i
++) {
34 revisionList
= realloc(revisionList
, size
* sizeof(struct list
));
37 struct list
* a
= revisionList
+ i
;
38 a
->numColumns
= i
% 5;
39 if (currentColumn
+ a
->numColumns
> totColumns
) {
41 printf("Reallocing columns. New total: %i\n", totColumns
);
42 columns
= realloc(columns
, totColumns
* sizeof(struct hash
));
45 for (j
= 0; j
< a
->numColumns
; j
++) {
46 //ccolumns[currentColumn++] = st
47 strncpy(columns
[currentColumn
++].value
, "Haha pieter is cool", 20);
51 printf("Num value at 3000 is: %i vs %i\n", revisionList
[3000].numColumns
, (int) (5 * random()));
52 printf("Value of 1000'd column is: %s\n", columns
[1000].value
);