git: 9front

Download patch

ref: c673a4ae9c7dbc7f8aa21f58397db26bf5337d70
parent: 50750b43f50b2a70aa61e36e38c0339613bff915
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Aug 14 10:45:19 EDT 2015

kernel: try freebroken() *before* killbig() (thanks aiju)

--- a/sys/src/9/port/swap.c
+++ b/sys/src/9/port/swap.c
@@ -164,8 +164,8 @@
 
 		if(swapimage.c == nil || swapalloc.free == 0){
 		Killbig:
-			killbig("out of memory");
-			freebroken();		/* can use the memory */
+			if(!freebroken())
+				killbig("out of memory");
 			sched();
 			continue;
 		}
--