List of commits:
Subject Hash Author Date (UTC)
memcheck.h: Added calloc wrapper macro 2af63cb7dea96120fa146f9e0e8e3ba4866038a6 Josiah Mullins 2023-11-03 16:09:35
Fixed "multiple definitions for fp_mem_log" error when using library across multiple .c files 923a622ea28c43c4636bbc24eb15c316993bfcd3 Josiah Mullins 2023-10-30 18:00:02
README: Updated README to reflect name change 20b55a22dba0975f17b3e173e9a693cc36e00484 Josiah Mullins 2023-10-28 12:52:24
moved mem_check.h to memcheck.h to reflect macro name change d75193eeb7855679bf15fd9e896cef36caae2213 Josiah Mullins 2023-10-23 19:34:53
mem_check.h: Renamed all macros to be in the format MEMCHECK_name dfc0166e38d3fce58b03033507d32dee23ca9feb Josiah Mullins 2023-10-23 19:33:14
mem_check.h: Added support for typecasting the declarations. 37dc1d6bdd6f4bf770d41146c6f614059b9f1d02 Josiah Mullins 2023-10-05 18:11:09
Moved mem_check.c to mem_check_scanner.c 4a6548f5dd52c419dfa3b46b53dc8ff17f044203 Josiah Mullins 2023-10-05 18:04:42
README: Added instructions to include init and close calls in program. 9ceea9c4ae0c169a69fc1a0840402bfc2a2843cc Josiah Mullins 2023-10-05 18:02:22
Fixed bug with allocate memory and added include guards. 01034908e928b996abf6b92804a9f68112617af1 Josiah_Mullins_E6440 2020-02-14 17:53:16
master: initial commit of mem_check ede7de7550d3243f98279b5bd69eba18748105fa Josiah_Mullins_E6440 2020-02-12 17:42:39
Commit 2af63cb7dea96120fa146f9e0e8e3ba4866038a6 - memcheck.h: Added calloc wrapper macro
Author: Josiah Mullins
Author date (UTC): 2023-11-03 16:09
Committer name: Josiah Mullins
Committer date (UTC): 2023-11-03 16:11
Parent(s): 923a622ea28c43c4636bbc24eb15c316993bfcd3
Signing key:
Tree: fe7248885fa6718558cc84fb51a625d89dd0804e
File Lines added Lines deleted
README 1 0
memcheck.h 10 0
File README changed (mode: 100644) (index 9799d8b..4b6ed67)
... ... 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 = (type)calloc(nmemb, size) ---> MEMCHECK_CALLOC(data,type,nmemb,size);
19 20 data = (type)malloc(size); ---> MEMCHECK_MALLOC(data,type,size); data = (type)malloc(size); ---> MEMCHECK_MALLOC(data,type,size);
20 21 new = realloc(old,size); ---> MEMTYPE_REALLOC(new,type,old,size); new = realloc(old,size); ---> MEMTYPE_REALLOC(new,type,old,size);
21 22 free(data); ---> MEMCHECK_FREE(data); free(data); ---> MEMCHECK_FREE(data);
File memcheck.h changed (mode: 100644) (index 04dd919..e94eea0)
... ... extern FILE* fp_mem_log;
15 15
16 16 //Place this with the global variables in your .c files //Place this with the global variables in your .c files
17 17 #define MEMCHECK_GLOBAL_VARS FILE* fp_mem_log; #define MEMCHECK_GLOBAL_VARS FILE* fp_mem_log;
18
19 #define MEMCHECK_CALLOC(data, type, nmemb, size) {\
20 data = (type)calloc(nmemb, size);\
21 fprintf(fp_mem_log,"a%p,0x0\n",(void*)data);\
22 }
23
18 24 #define MEMCHECK_MALLOC(data, type, size) {\ #define MEMCHECK_MALLOC(data, type, size) {\
19 25 data = (type)malloc(size);\ data = (type)malloc(size);\
20 26 fprintf(fp_mem_log,"a%p,0x0\n",(void*)data);\ fprintf(fp_mem_log,"a%p,0x0\n",(void*)data);\
 
... ... extern FILE* fp_mem_log;
48 54
49 55 #define MEMCHECK_GLOBAL_VARS #define MEMCHECK_GLOBAL_VARS
50 56
57 #define MEMCHECK_CALLOC(data, type, nnmemb, size) {\
58 data = (type)calloc(nmemb, size);\
59 }
60
51 61 #define MEMCHECK_MALLOC(data, type, size) {\ #define MEMCHECK_MALLOC(data, type, size) {\
52 62 data = (type)malloc(size);\ data = (type)malloc(size);\
53 63 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/ORpKTKoVQnFhs/Memory_Check

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/ORpKTKoVQnFhs/Memory_Check

Clone this repository using git:
git clone git://git.rocketgit.com/user/ORpKTKoVQnFhs/Memory_Check

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main