commit f7cca88267372c8a5a771923a19ea4f817113cf2
parent cbc99e3e52703f61aee028b34f135c2e05a6a5db
Author: David du Colombier <0intro@gmail.com>
Date: Tue, 7 Jun 2011 14:25:02 -0400
libventi: import changes from plan 9
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4530100
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/libventi/mem.c b/src/libventi/mem.c
@@ -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++;
}