📄 test3_1.c
字号:
/* test3_1.c
* This example program shows how to temporarily disable MSS. Maybe it isn't
* the best example but you should get the idea - the program allocates 100,
* 200 and 400 bytes, but in the log you should see only the allocations of
* 100 and 400.
*/
#include <mss.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
void * mem;
puts("Logged allocation...");
mem = malloc(100);
free(mem);
#ifdef MSS
#include <no_mss.h>
#endif
puts("Unlogged allocation...");
mem = malloc(200);
free(mem);
#ifdef __MSS_H_REINCLUDE
#include <mss.h>
#endif
puts("Logged again...");
mem = malloc(400);
free(mem);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -