# HG changeset patch # User tobaru # Date 1579782270 -32400 # Node ID f4effd36aefc315138ee5eae0d345bb2660b2424 # Parent 6e03cee9733ef5eec736d35b8e39c324e32dd79c kpt_alloc diff -r 6e03cee9733e -r f4effd36aefc src/impl/vm_impl_private.cbc --- a/src/impl/vm_impl_private.cbc Thu Jan 23 21:16:42 2020 +0900 +++ b/src/impl/vm_impl_private.cbc Thu Jan 23 21:24:30 2020 +0900 @@ -121,9 +121,13 @@ if ((r = kpt_mem.freelist) != NULL ) { kpt_mem.freelist = r->next; } - goto kpt_alloc_check_inital_page(vm_impl, next(...)); -} + release(&kpt_mem.lock); -__code kpt_alloc_check_inital_page(struct vm_impl* vm_impl, __code next(...)) { + if ((r == NULL) && ((r = kmalloc (PT_ORDER)) == NULL)) { + // panic("oom: kpt_alloc"); + // goto panic + } + + memset(r, 0, PT_SZ); goto next((char*)r); }