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

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

View File

@ -2570,20 +2570,23 @@ 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; for (file = exchange_vars.file.free_list.next;
file != &exchange_vars.file.free_list; file != &exchange_vars.file.free_list;
file = file->next){ file = file->next){
++free_list_count;
if (file->data){ if (file->data){
system_free_memory(file->data); system_free_memory(file->data);
} }
} }
if (exchange_vars.file.free_list.next != &exchange_vars.file.free_list){ 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, ex__insert_range(exchange_vars.file.free_list.next, exchange_vars.file.free_list.prev,
&exchange_vars.file.available); &exchange_vars.file.available);
exchange_vars.file.num_active -= free_list_count;
} }
ex__check(&exchange_vars.file); ex__check(&exchange_vars.file);