libventi: import changes from plan 9

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4530100
This commit is contained in:
David du Colombier 2011-06-07 14:25:02 -04:00 committed by Russ Cox
parent cbc99e3e52
commit f7cca88267

View file

@ -54,8 +54,7 @@ vtbrk(int n)
{
static Lock lk;
static uchar *buf;
static int nbuf;
static int nchunk;
static int nbuf, nchunk;
int align, pad;
void *p;
@ -67,11 +66,11 @@ vtbrk(int n)
align = 4;
lock(&lk);
pad = (align - (ulong)buf) & (align-1);
pad = (align - (uintptr)buf) & (align-1);
if(n + pad > nbuf) {
buf = vtmallocz(ChunkSize);
nbuf = ChunkSize;
pad = (align - (ulong)buf) & (align-1);
pad = (align - (uintptr)buf) & (align-1);
nchunk++;
}