From 7d8d997e0da6b53946e4f0ecb77e0481edeca95f Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 21 Nov 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-11-21 --- port/alloc.c | 6 +++++- port/chan.c | 2 +- port/portdat.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/port/alloc.c b/port/alloc.c index 1ee12f448aa21943c411ccb8ca9ce9824523e8cc..ddcb1c1854e16b3b1cc146b82c11f39945544f7b 100644 --- a/port/alloc.c +++ b/port/alloc.c @@ -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<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; } diff --git a/port/chan.c b/port/chan.c index 3ce7e2a2db43a8b29595ffaab53483a72aa6ca89..0b18449d0fddc377e189e561a1b71e1b4c054283 100644 --- a/port/chan.c +++ b/port/chan.c @@ -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); diff --git a/port/portdat.h b/port/portdat.h index d198f4201d59ea41c7cee43803c83673bc0f3b48..00bdd34709b4e8db0ca672cc0ca7103722c24e37 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -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