more idiomatic c
This commit is contained in:
parent
96e16b96c9
commit
84d79573da
1 changed files with 5 additions and 8 deletions
9
kalloc.c
9
kalloc.c
|
@ -31,7 +31,7 @@ void ktest();
|
|||
* after _end.
|
||||
*/
|
||||
void
|
||||
kinit()
|
||||
kinit(void)
|
||||
{
|
||||
extern int end;
|
||||
unsigned mem;
|
||||
|
@ -133,7 +133,7 @@ kalloc(int n)
|
|||
}
|
||||
|
||||
void
|
||||
ktest()
|
||||
ktest(void)
|
||||
{
|
||||
char *p1, *p2, *p3;
|
||||
|
||||
|
@ -158,10 +158,7 @@ ktest()
|
|||
|
||||
// test running out of memory
|
||||
p1 = 0;
|
||||
while(1){
|
||||
p2 = kalloc(PAGE);
|
||||
if(p2 == 0)
|
||||
break;
|
||||
while((p2 = kalloc(PAGE)) != 0){
|
||||
*(char**)p2 = p1;
|
||||
p1 = p2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue