Fix wrong #ifdef INDIRECT_SWAP
authorNick Downing <nick@ndcode.org>
Sat, 8 Jun 2019 01:25:54 +0000 (11:25 +1000)
committerNick Downing <nick@ndcode.org>
Sat, 8 Jun 2019 01:25:54 +0000 (11:25 +1000)
process.c

index 5d734b4..f8d4f45 100644 (file)
--- a/process.c
+++ b/process.c
@@ -115,7 +115,7 @@ static bool do_swap_out(int swap_out) {
 #ifdef INDIRECT_SWAP
     if (swap_block_pool.avail == 0)
       return false;
-#endif
+#endif /* INDIRECT_SWAP */
 
     assert(victim->prev != &lru_head);
     process = (struct process *)(
@@ -125,10 +125,10 @@ static bool do_swap_out(int swap_out) {
 
     // calculate amount to swap out
     blocks = calc.in_core_block - calc.block_base;
-#ifndef INDIRECT_SWAP
+#ifdef INDIRECT_SWAP
     if (blocks > swap_block_pool.avail)
       blocks = swap_block_pool.avail;
-#endif
+#endif /* INDIRECT_SWAP */
     if (blocks > swap_out)
       blocks = swap_out;
  printf("victim %d, swap out %d of %d\n", (int)(process - processes), blocks, calc.in_core_block - calc.block_base);