Merge pull request #24 from jlferrer/fix_compiler_big_files
This commit is contained in:
commit
c79b3afbbd
1 changed files with 11 additions and 3 deletions
|
|
@ -1340,14 +1340,22 @@ int main() {
|
|||
struct node *all_files = NULL, *all_structs = NULL;
|
||||
struct id_bst *used_import_ids = NULL;
|
||||
int i, j;
|
||||
uint64_t total_len=0;
|
||||
struct capn_segment *current_seg;
|
||||
|
||||
if (capn_init_fp(&capn, stdin, 0)) {
|
||||
if (capn_init_fp(&capn, stdin, 0)==-1) {
|
||||
fprintf(stderr, "failed to read schema from stdin\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_valseg.data = calloc(1, capn.seglist->len);
|
||||
g_valseg.cap = capn.seglist->len;
|
||||
current_seg = capn.seglist;
|
||||
do{
|
||||
total_len+=current_seg->len;
|
||||
current_seg = current_seg->next;
|
||||
}while(current_seg);
|
||||
|
||||
g_valseg.data = calloc(1, total_len);
|
||||
g_valseg.cap = total_len;
|
||||
|
||||
root.p = capn_getp(capn_root(&capn), 0, 1);
|
||||
read_CodeGeneratorRequest(&req, root);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue