ref: fc81383d17b7b2c7379456470a5781f5a90462c5
parent: a1d44aa288dae05ff87db25a10ad3fc6a1f0e640
author: Ori Bernstein <[email protected]>
date: Mon Dec 25 23:57:10 EST 2023
blk: explain why we want 2 passes when allocing a block
--- a/blk.c
+++ b/blk.c
@@ -563,6 +563,12 @@
tries = 0;
Again:
a = pickarena(ty, hint, tries);
+ /*
+ * Loop through the arena up to 2 times.
+ * The first pass tries to find an arena
+ * that has space and is not in use, the
+ * second waits until an arena is free.
+ */
if(tries == 2*fs->narena)
error(Efull);
tries++;