📄 testbss.c
字号:
// test reads and writes to a large bss#include <inc/lib.h>#define ARRAYSIZE (1024*1024)uint32_t bigarray[ARRAYSIZE];voidumain(void){ int i; cprintf("Making sure bss works right...\n"); for (i = 0; i < ARRAYSIZE; i++) if (bigarray[i] != 0) panic("bigarray[%d] isn't cleared!\n", i); for (i = 0; i < ARRAYSIZE; i++) bigarray[i] = i; for (i = 0; i < ARRAYSIZE; i++) if (bigarray[i] != i) panic("bigarray[%d] didn't hold its value!\n", i); cprintf("Yes, good. Now doing a wild write off the end...\n"); bigarray[ARRAYSIZE+1024] = 0; panic("SHOULD HAVE TRAPPED!!!");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -