<html><body><div>Greetings,</div><div><br></div><div>I don't think your counterexample here is valid as 3 = 0b11 and not 0b101 (= 5).</div><div><br></div><div>Sincerely,</div><div><br></div><div>Miroslav Hrabal<br></div><div><br></div><div><br></div><aside>
---------- Původnà e-mail ----------<br>
Od: Thomas Mol <thomasfolkertmol@gmail.com><br>
Komu: Operating Systems Course <nswi004@d3s.mff.cuni.cz><br>
Datum: 5. 1. 2021 0:43:29<br>
PÅedmÄt: [NSWI004] Note on is_power_of_two
</aside><br><blockquote data-email="thomasfolkertmol@gmail.com">Good night,<br><br>The trick used in the is_power_of_two inline looks nice, but it's not<br>actually valid. For example, 3 has no common bits with 3 - 1 (0b101<br>and 0b010).<br>Is there a particular reason our frame allocator should only allocate<br>powers of two anyway?<br><br>Best regards,<br>Thomas Folkert Mol<br>_______________________________________________<br>NSWI004 mailing list<br>NSWI004@d3s.mff.cuni.cz<br>https://d3s.mff.cuni.cz/mailman/listinfo/nswi004<br></blockquote></body></html>