File README changed (mode: 100644) (index 689c3bd..4cd674d) |
... |
... |
scanner will alert you of that. |
16 |
16 |
To start using this project you would add the line |
To start using this project you would add the line |
17 |
17 |
"#include <mem_check.h>" into your program and replace |
"#include <mem_check.h>" into your program and replace |
18 |
18 |
the stdlib functions as shown below. |
the stdlib functions as shown below. |
19 |
|
data = malloc(size); ---> allocate_memory(data,size); |
|
20 |
|
new = realloc(old,size); ---> realloc_memory(new, old, size); |
|
21 |
|
free(data); ---> free_memory(data); |
|
|
19 |
|
data = (type)malloc(size); ---> MEMCHECK_MALLOC(data,type,size); |
|
20 |
|
new = realloc(old,size); ---> MEMTYPE_REALLOC(new,type,old,size); |
|
21 |
|
free(data); ---> MEMCHECK_FREE(data); |
22 |
22 |
|
|
23 |
|
Next, add the line "init_mem_check();" |
|
|
23 |
|
Next, add the line "MEMCHECK_INIT();" |
24 |
24 |
before any memory handling function calls. |
before any memory handling function calls. |
25 |
|
Lastly, add the line "close_mem_check();" |
|
|
25 |
|
Lastly, add the line "MEMCHECK_CLOSE();" |
26 |
26 |
after your last memory handling call. |
after your last memory handling call. |
27 |
27 |
|
|
28 |
28 |
If you recompile your program and run it you |
If you recompile your program and run it you |
|
... |
... |
reinstate the stdlib versions, then add the line |
33 |
33 |
#define MEM_CHECK 0 |
#define MEM_CHECK 0 |
34 |
34 |
above the line |
above the line |
35 |
35 |
#include <mem_check.h> |
#include <mem_check.h> |
|
36 |
|
in your source code. |