update linux file exchange stuff so it works with >32 files

This commit is contained in:
insofaras 2016-03-24 02:36:42 +00:00
parent 08b69a6630
commit 1f415d13fc
1 changed files with 9 additions and 6 deletions

View File

@ -2571,19 +2571,22 @@ main(int argc, char **argv)
}
}
Assert(d == exchange_vars.file.num_active);
int free_list_count = 0;
for (file = exchange_vars.file.free_list.next;
file != &exchange_vars.file.free_list;
file = file->next){
++free_list_count;
if (file->data){
system_free_memory(file->data);
}
}
if (exchange_vars.file.free_list.next != &exchange_vars.file.free_list){
Assert(free_list_count != 0);
ex__insert_range(exchange_vars.file.free_list.next, exchange_vars.file.free_list.prev,
&exchange_vars.file.available);
exchange_vars.file.num_active -= free_list_count;
}
ex__check(&exchange_vars.file);