Introduction The usual implementation of malloc and free are unforgiving to errors in their callers' code, including cases where the programmer overflows an array, forgets to free memory, or frees a memory block twice. This often does not affect the program immediately, waiting until the corrupted memory is used later (in the case of overwrites) or gradually accumulating allocated but unused blocks. Thus, debugging can be extremely difficult. In this assignment, you will write a wrapper for the malloc package that will catch errors in the code that calls malloc and free. The skills you will have learned upon the completion of this exercise are pointer arithmetic and a greater understanding of the consequences of subtle memory mistakes. Logistics Unzip debugging_malloc.zip into an empty directory. The files contained are as follows: File(s): Function: debugmalloc.c Contains the implementation of the three functions you will be writing. This is the one file you will be editing and handing in. debugmalloc.h Contains the declaration of the functions, as well as the macros that will call them. driver.c Contains main procedure and the code that will be calling the functions in the malloc package dmhelper.c, dmhelper.h Contain the helper functions and macros that you will be calling from your code grader.pl Perl script that runs your code for the various test cases and gives you feedback based on your current code debugmalloc.dsp Exercise 3 project file debugmalloc.dsw Exercise 3 workspace file tailor.h, getopt.c, getopt.h Tools that are used only by the driver program for I/O purposes. You will not need to know what the code in these files do. Others Required by Visual C++. You do not need to understand their purpose Specification Programs that use this package will call the macros MALLOC and FREE. MALLOC and FREE are used exactly the same way as the malloc() and free() functions in the standard C malloc package. That is, the li
2019-12-21 21:00:53 2KB Debugging Malloc Memory Errors
1
Malloc和mfree函数的实现原理,可参考
2019-12-21 20:00:38 7KB C语言 free malloc
1
卡内基梅隆大学15213第六个malloc lab 用seglist写的,89分代码
2019-12-21 19:59:54 11KB malloclab
1
用C自己实现malloc和free,需要的可以看下,没实际用处,不过可以了解C的原型原理
2019-12-21 19:42:11 818B C malloc free C语言
1
采用seg-list结构,易于理解,适合和我一样的弱渣使用,好好调参,可以得到93分,我觉得可以接受
2019-12-21 19:29:41 13KB csapp malloc lab 原创
1