git: 9front

Download patch

ref: ecb19ace6549506cc0cb6b43ea0f09d246d5d1e0
parent: 5b1fc56b00d8ad52d3c5ac156d296de0af2bd17a
parent: b507b0ab0519a60b1810719aabdfb2770df6ed4e
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue May 21 14:58:13 EDT 2013

merge

--- a/sys/src/9/port/allocb.c
+++ b/sys/src/9/port/allocb.c
@@ -64,10 +64,16 @@
 	 */
 	if(up == nil)
 		panic("allocb without up: %#p", getcallerpc(&size));
-	if((b = _allocb(size)) == nil){
-		xsummary();
-		mallocsummary();
-		panic("allocb: no memory for %d bytes", size);
+	while((b = _allocb(size)) == nil){
+		if(up->nlocks.ref || m->ilockdepth || !islo()){
+			xsummary();
+			mallocsummary();
+			panic("allocb: no memory for %d bytes", size);
+		}
+		if(!waserror()){
+			resrcwait("no memory for allocb");
+			poperror();
+		}
 	}
 	setmalloctag(b, getcallerpc(&size));
 
--