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

📄 debugmalloc.h

📁 SSD6网上教程全部练习及答案 原版的正确答案
💻 H
字号:
#ifndef DEBUGMALLOC_H
#define DEBUGMALLOC_H

#include <stdlib.h>

/* Macros that will call the wrapper functions with
	the current filename and line number */

#define MALLOC(s)	MyMalloc(s, __FILE__, __LINE__)
#define FREE(p)		MyFree(p, __FILE__, __LINE__)

/* Wrappers for malloc and free.  You will implement
	these functions. */

void *MyMalloc(size_t size, char *filename, int linenumber);
void MyFree(void *ptr, char *filename, int linenumber);


/* Required function for detecting memory leaks */

int AllocatedSize(); /* returns number of bytes allocated */


/* Optional functions if you wish to implement the global list */

void PrintAllocatedBlocks();
int HeapCheck(); /* returns 0 if all blocks have not been corrupted,
					-1 if an error is detected */


#endif

⌨️ 快捷键说明

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