# HG changeset patch # User tobaru # Date 1580033276 -32400 # Node ID 597c79dd5851f5f5aaa555a806fe8861ddd431b8 # Parent f9169495d476c59e86cfa6ea004a042d8eeaa2a1 kmalloc log test diff -r f9169495d476 -r 597c79dd5851 src/buddy.c --- a/src/buddy.c Sun Jan 26 18:20:40 2020 +0900 +++ b/src/buddy.c Sun Jan 26 19:07:56 2020 +0900 @@ -247,7 +247,6 @@ { uint8 *up; - ln(order); if ((order > MAX_ORD) || (order < MIN_ORD)) { panic("kmalloc: order out of range\n"); } diff -r f9169495d476 -r 597c79dd5851 src/gearsTools/lib/Gears/Context/Template/XV6.pm --- a/src/gearsTools/lib/Gears/Context/Template/XV6.pm Sun Jan 26 18:20:40 2020 +0900 +++ b/src/gearsTools/lib/Gears/Context/Template/XV6.pm Sun Jan 26 19:07:56 2020 +0900 @@ -30,9 +30,10 @@ # endif #endif +#include "ln.h" #ifdef XV6KERNEL extern void* kmalloc (int order); -#define calloc(a,b) kmalloc((a)*(b)) +#define calloc(a,b) kmalloc(ln((a)*(b))) #define free(a) kfree(a) #else extern void* malloc(unsigned int sz); @@ -40,7 +41,7 @@ #define free(a) free(a) #endif -#define ALLOCATE_SIZE 12 +#define ALLOCATE_SIZE 20000 #define NEW(type) (type*)(calloc(1, sizeof(type))) #define NEWN(n, type) (type*)(calloc(n, sizeof(type)))