⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memory.c

📁 Newlib 嵌入式 C库 标准实现代码
💻 C
字号:
/* WinBond bug report   malloc() returns 0x0.   test the memory calls. These test sbrk(), which is part of glue.c   for most architectures. */#include <stdio.h>#define BUFSIZE 80main(){  char *buf;  char *tmp;  char *result;  /* see if we can get some memory */  buf = (char *)malloc(BUFSIZE);  if (buf != 0x0) {    pass ("malloc");  } else {    fail ("malloc");  }  /* see if we can realloc it */  tmp = buf;  result = (char *)realloc (buf, BUFSIZE+100);   if ((buf != 0x0) && (result != 0x0)) {    pass ("realloc");  } else {    fail ("realloc");  }      /* see if we can free it up. FIXME: how to test free ?*/  free (buf);  fflush (stdout);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -