The example input for FIFO that shows the Belady anamoly uses “-n 3”, shouldn the number of page frames be a power of 2?
The assignment says you can assume the number of pages will be a power of two (so if you rely on this you may not be able to run the FIFO test code made available). However, there is no reason that the number of pages of physical memory must be a power of 2. In reality it would be difficult to purchase memory so that you didn’t have a power of 2 (assuming the page size is also a power of 2), but keep in mind that it is feasible that the OS reserves some pages for itself (so the pages left for the virtual memory software to use could easily be something other than a power of 2). At a minimum, the OS must make sure that the pages that hold the page fault handling software must be kept in memory! We won’t test your code with anything other than a power of 2.