--- /sys/man/2/malloc Mon Dec 3 00:42:18 2007 +++ /sys/man/2/malloc Thu Sep 5 00:57:51 2013 @@ -78,7 +78,7 @@ .PP .I Mallocalign allocates a block of at least -.I n +.I size bytes of memory respecting alignment contraints. If .I align @@ -91,8 +91,8 @@ .I span is non-zero, the -.I n -byte block allocated will not span a +.IR size -byte +block allocated will not span a .IR span -byte boundary. .PP @@ -107,18 +107,20 @@ lesser of the new and old sizes. .I Realloc takes on special meanings when one or both arguments are zero: +.TF "\fLrealloc(0, sz) +.PD .TP -.B "realloc(0,\ size) +.B "realloc(0, sz) means -.LR malloc(size) ; +.LR malloc(sz) ; returns a pointer to the newly-allocated memory .TP -.B "realloc(ptr,\ 0) +.B "realloc(ptr, 0) means .LR free(ptr) ; returns null .TP -.B "realloc(0,\ 0) +.B "realloc(0, 0) no-op; returns null .PD .PP --- /sys/src/9/port/proc.c Fri Jul 12 22:09:33 2013 +++ /sys/src/9/port/proc.c Wed Sep 4 20:19:44 2013 @@ -419,7 +419,7 @@ return; } - if(up != p) + if(up != p && (p->wired == nil || p->wired == m)) m->readied = p; /* group scheduling */ updatecpu(p); @@ -505,6 +505,7 @@ /* cooperative scheduling until the clock ticks */ if((p=m->readied) && p->mach==0 && p->state==Ready + && (p->wired == nil || p->wired == m) && runq[Nrq-1].head == nil && runq[Nrq-2].head == nil){ skipscheds++; rq = &runq[p->priority]; @@ -848,7 +849,7 @@ nexterror(); } sleep(r, tfn, arg); - if (up->tt) + if(up->tt) timerdel(up); up->twhen = 0; poperror();