From b6095304b7ee2b69d2ee4a9a7265999d1a2b9675 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 10 Aug 2007 16:37:27 +0000 Subject: Make cp a magic symbol. --- kalloc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'kalloc.c') diff --git a/kalloc.c b/kalloc.c index bfa9207..cc2faac 100644 --- a/kalloc.c +++ b/kalloc.c @@ -40,24 +40,22 @@ kinit(void) kfree(start, mem * PAGE); } -// Free the len bytes of memory pointed at by cp, +// Free the len bytes of memory pointed at by v, // which normally should have been returned by a -// call to kalloc(cp). (The exception is when +// call to kalloc(len). (The exception is when // initializing the allocator; see kinit above.) void -kfree(char *cp, int len) +kfree(char *v, int len) { struct run **rr; - struct run *p = (struct run*) cp; - struct run *pend = (struct run*) (cp + len); - int i; + struct run *p = (struct run*)v; + struct run *pend = (struct run*)(v + len); if(len % PAGE) panic("kfree"); // Fill with junk to catch dangling refs. - for(i = 0; i < len; i++) - cp[i] = 1; + memset(v, 1, len); acquire(&kalloc_lock); -- cgit v1.2.3