mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.6k stars 2.38k forks source link

Should kinit initialize kmem.freelist? #99

Closed ChaoWao closed 2 years ago

ChaoWao commented 2 years ago

In kernel/kalloc.c, I found that kmem.freelist is not initialized. As a general approach, we set NULL to be the end of a list. Why does kmem.freelist not be initialized?

ChaoWao commented 2 years ago

Ohh... I think because it is global data and is automatically initialized to 0...