~kris/9p

9hist

7d8d997e0da6b53946e4f0ecb77e0481edeca95f — David du Colombier 32 years ago 8aa2a47
Plan 9 from Bell Labs 1993-11-21
3 files changed, 8 insertions(+), 2 deletions(-)

M port/alloc.c
M port/chan.c
M port/portdat.h
M port/alloc.c => port/alloc.c +5 -1
@@ 63,6 63,7 @@ struct Bucket
	int	size;
	int	magic;
	Bucket	*next;
	ulong	pc;
	char	data[1];
};



@@ 260,6 261,8 @@ malloc(ulong size)
	ulong next;
	int pow, n;
	Bucket *bp, *nbp;
ulong pc;
pc = getcallerpc(0);

	for(pow = 3; pow <= Maxpow; pow++)
		if(size <= (1<<pow))


@@ 278,7 281,7 @@ good:
			panic("malloc");

		bp->magic = Magic2n;

bp->pc = pc;
		memset(bp->data, 0,  size);
		return  bp->data;
	}


@@ 318,6 321,7 @@ good:

	bp->size = pow;
	bp->magic = Magic2n;
bp->pc = pc;
	return bp->data;
}


M port/chan.c => port/chan.c +1 -1
@@ 550,7 550,7 @@ namec(char *name, int amode, int omode, ulong perm)
		if(r == 'M') {
			if(amode != Aopen || omode != ORDWR)
				error(Eperm);
			name = skipslash(name);
			skipslash(name);
			return mchan(elem+n);
		}
		t = devno(r, 1);

M port/portdat.h => port/portdat.h +2 -0
@@ 276,6 276,8 @@ struct Mnt
	ushort	flushtag;	/* Tag to send flush on */
	ushort	flushbase;	/* Base tag of flush window for this buffer */
	Pthash	tree;		/* Path names from this mount point */
	char	*partial;	/* Outstanding read data */
	int	npart;		/* Sizeof remains */
};

enum