jcs's openbsd hax
openbsd

Make the freelist best fit code a tiny bit smarter to not use a block if half or more would be wasted. Causes more effective re-use of blocks. ok jsing@

otto cd84e9e2 88955bc3

+2 -2
+2 -2
sys/lib/libsa/alloc.c
··· 1 - /* $OpenBSD: alloc.c,v 1.12 2016/03/14 23:08:06 krw Exp $ */ 1 + /* $OpenBSD: alloc.c,v 1.13 2018/12/16 08:31:50 otto Exp $ */ 2 2 /* $NetBSD: alloc.c,v 1.6 1997/02/04 18:36:33 thorpej Exp $ */ 3 3 4 4 /* ··· 169 169 } 170 170 171 171 /* no match in freelist if bestsize unchanged */ 172 - failed = (bestsize == 0xffffffff); 172 + failed = (bestsize == 0xffffffff || bestsize >= size * 2); 173 173 #endif 174 174 175 175 if (failed) { /* nothing found */