diff options
| author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-05-21 18:58:13 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-05-21 18:58:13 +0200 |
| commit | 7a9ecbed6a5baa70d5e7248f8a8d5d5eb88260e6 (patch) | |
| tree | 1c655f9bbc800312d949fae5f06f9f01a8841f98 | |
| parent | 5331734335d2f1fbe5af90ca6b56ec10ffac48a6 (diff) | |
| parent | 8a3a36fc056950f2d5aa3bc6b9587fc5e2984ca2 (diff) | |
| download | plan9front-7a9ecbed6a5baa70d5e7248f8a8d5d5eb88260e6.tar.xz | |
merge
| -rw-r--r-- | sys/src/9/port/allocb.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/src/9/port/allocb.c b/sys/src/9/port/allocb.c index c6989452b..97176d76d 100644 --- a/sys/src/9/port/allocb.c +++ b/sys/src/9/port/allocb.c @@ -64,10 +64,16 @@ allocb(int size) */ 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)); |
