From 238060cba6188f11837d551cddc1233e210fc391 Mon Sep 17 00:00:00 2001 From: yxfzdnbc Date: Tue, 2 Oct 2018 20:26:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dslab=5Fmalloc=E4=B8=ADSlab?= =?UTF-8?q?=E7=BB=93=E6=9E=84using=5Fcount=E5=AD=97=E6=AE=B5=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/memory.c b/kernel/memory.c index b76b7f9..507fac7 100644 --- a/kernel/memory.c +++ b/kernel/memory.c @@ -814,7 +814,7 @@ void * slab_malloc(struct Slab_cache * slab_cache,unsigned long arg) page_init(tmp_slab->page,PG_Kernel); - tmp_slab->using_count = PAGE_2M_SIZE/slab_cache->size; + tmp_slab->using_count = 0; tmp_slab->free_count = tmp_slab->using_count; tmp_slab->Vaddress = Phy_To_Virt(tmp_slab->page->PHY_address); -- Gitee