From 1f415d13fc9d5702e2389c9961bd38c51a29df34 Mon Sep 17 00:00:00 2001 From: insofaras Date: Thu, 24 Mar 2016 02:36:42 +0000 Subject: [PATCH] update linux file exchange stuff so it works with >32 files --- linux_4ed.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linux_4ed.cpp b/linux_4ed.cpp index 494020e6..b1fb76ee 100644 --- a/linux_4ed.cpp +++ b/linux_4ed.cpp @@ -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; - file != &exchange_vars.file.free_list; - file = file->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.available); + + exchange_vars.file.num_active -= free_list_count; } ex__check(&exchange_vars.file);