make smalloc() uninterruptable as most callers cant handle it anyway
This commit is contained in:
parent
1a450db960
commit
5acde1e791
4 changed files with 13 additions and 8 deletions
|
@ -174,7 +174,10 @@ smalloc(ulong size)
|
|||
v = poolalloc(mainmem, size+Npadlong*sizeof(ulong));
|
||||
if(v != nil)
|
||||
break;
|
||||
if(!waserror()){
|
||||
tsleep(&up->sleep, return0, 0, 100);
|
||||
poperror();
|
||||
}
|
||||
}
|
||||
if(Npadlong){
|
||||
v = (ulong*)v+Npadlong;
|
||||
|
|
|
@ -440,7 +440,10 @@ smalloc(ulong size)
|
|||
remember(getcallerpc(&size), v);
|
||||
if(v != nil)
|
||||
break;
|
||||
if(!waserror()){
|
||||
tsleep(&up->sleep, return0, 0, 100);
|
||||
poperror();
|
||||
}
|
||||
}
|
||||
memset(v, 0, size);
|
||||
return v;
|
||||
|
|
|
@ -283,7 +283,11 @@ envwrite(Chan *c, void *a, long n, vlong off)
|
|||
|
||||
len = offset+n;
|
||||
if(len > e->len) {
|
||||
s = smalloc(len);
|
||||
s = malloc(len);
|
||||
if(s == nil){
|
||||
wunlock(eg);
|
||||
error(Enomem);
|
||||
}
|
||||
if(e->value){
|
||||
memmove(s, e->value, e->len);
|
||||
free(e->value);
|
||||
|
|
|
@ -1123,12 +1123,7 @@ pexit(char *exitstr, int freemem)
|
|||
panic("boot process died: %s", exitstr);
|
||||
}
|
||||
|
||||
while(waserror())
|
||||
;
|
||||
|
||||
wq = smalloc(sizeof(Waitq));
|
||||
poperror();
|
||||
|
||||
wq->w.pid = up->pid;
|
||||
utime = up->time[TUser] + up->time[TCUser];
|
||||
stime = up->time[TSys] + up->time[TCSys];
|
||||
|
|
Loading…
Reference in a new issue