{"id":13339651,"url":"https://github.com/Felix-Quehl/C_Memory_Manager","last_synced_at":"2025-03-11T14:32:08.085Z","repository":{"id":50480970,"uuid":"518471068","full_name":"Felix-Quehl/C_Memory_Manager","owner":"Felix-Quehl","description":"Library to trace and manage pointers in C","archived":false,"fork":false,"pushed_at":"2023-06-22T13:04:30.000Z","size":60,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T03:14:25.692Z","etag":null,"topics":["c","debug","leak","library","linux","macos","macosx","management","memory","pointer","test","trace","unit","unix"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Felix-Quehl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T13:32:20.000Z","updated_at":"2024-09-06T08:04:07.000Z","dependencies_parsed_at":"2024-10-23T23:02:59.839Z","dependency_job_id":"a12603e1-b309-4f3c-be3d-7d85641772e5","html_url":"https://github.com/Felix-Quehl/C_Memory_Manager","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felix-Quehl%2FC_Memory_Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felix-Quehl%2FC_Memory_Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felix-Quehl%2FC_Memory_Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Felix-Quehl%2FC_Memory_Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Felix-Quehl","download_url":"https://codeload.github.com/Felix-Quehl/C_Memory_Manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243051995,"owners_count":20228310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","debug","leak","library","linux","macos","macosx","management","memory","pointer","test","trace","unit","unix"],"created_at":"2024-07-29T19:21:07.962Z","updated_at":"2025-03-11T14:32:07.813Z","avatar_url":"https://github.com/Felix-Quehl.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# C Memory Manager \u003cbr\u003e [![build_and_test](https://github.com/Felix-Quehl/C_Memory_Manager/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/Felix-Quehl/C_Memory_Manager/actions/workflows/build_and_test.yml)[![code_analysis](https://github.com/Felix-Quehl/C_Memory_Manager/actions/workflows/code_analysis.yml/badge.svg)](https://github.com/Felix-Quehl/C_Memory_Manager/actions/workflows/code_analysis.yml)\n\nThis repo contains the code for a **united-tested** memory manager library in C.\nThe library helps the consumer to keep track of memory allocations and detect memory leaks.\n\nPlease look at the unit test code to see how it's used.\n\n## Build \u0026 Test\n\n### Build\n\nUse `make` to build a clean release version.\n\n```bash\nmake clean release\n```\n\nSample Output:\n\n```bash\nrm -fr libmem.so test.out libmem.so mem.h out\ncd ./mem \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make clean\nrm -rf  libmem.so\ncd ./mem.test \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make clean\nrm -rf  test.out *.profraw *.profdata\ncd ./mem \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make \nclang -Weverything -Wall -Wextra -Werror -Wpedantic -fno-inline -Wno-poison-system-directories -I./header  -o code/mem.o -c code/mem.c \nclang --shared code/mem.o -o libmem.so\nmkdir -p out\ncp ./mem/libmem.so ./out\ncp ./mem/header/mem.h ./out\n```\n\nAfter `make` completed the build completed, you can grab the dynamic linkable library file and the header file from the out directory: `./out`\n\n\n### Test\n\nJust use `make` to test everything.\n\n```bash\nmake clean test\n```\n\nSample Output:\n\n```bash\nrm -fr libmem.so test.out libmem.so mem.h out\ncd ./mem \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make clean\nrm -rf .//code/mem.o libmem.so\ncd ./mem.test \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make clean\nrm -rf .//code/main.o .//code/test.o test.out *.profraw *.profdata\ncd ./mem \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make debug\nclang -Weverything -Wall -Wextra -Werror -Wpedantic -fno-inline -Wno-poison-system-directories -I./header -g -fprofile-instr-generate -fcoverage-mapping  -o code/mem.o -c code/mem.c \nclang --shared -fprofile-instr-generate -fcoverage-mapping code/mem.o -o libmem.so\ncd ./mem.test \u0026\u0026 /Applications/Xcode.app/Contents/Developer/usr/bin/make debug\nclang -Weverything -Wall -Wextra -Werror -Wpedantic -Wno-poison-system-directories -I./header -I../mem/header -g -fprofile-instr-generate -fcoverage-mapping  -o code/main.o -c code/main.c \nclang -Weverything -Wall -Wextra -Werror -Wpedantic -Wno-poison-system-directories -I./header -I../mem/header -g -fprofile-instr-generate -fcoverage-mapping  -o code/test.o -c code/test.c \nclang -L../mem -lmem -fprofile-instr-generate -fcoverage-mapping code/main.o code/test.o -o test.out\n./mem.test/test.out \n**************************************************\n\nTesting:\n\n               test_with_single_value_with_dedicated_release    :       Pass\n                 test_with_single_value_with_generic_release    :       Pass\n                 test_with_two_values_with_dedicated_release    :       Pass\n      test_with_two_values_with_dedicated_release_in_reverse    :       Pass\n            test_with_multiple_values_with_dedicated_release    :       Pass\n                        test_with_external_allocated_pointer    :       Pass\n                                   test_that_no_leaks_remain    :       Pass\n\n**************************************************\nxcrun llvm-profdata merge -sparse ./mem.test/mem.profraw -o ./mem.test/mem.profdata\nxcrun llvm-cov export ./mem/libmem.so -instr-profile=./mem.test/mem.profdata | python3 ./.util/coverage_check.py 80\n**************************************************\n\nCoverage:\n\n        branches        :       94.44%\n        functions       :       100.00%\n        instantiations  :       100.00%\n        lines           :       100.00%\n        regions         :       100.00%\n\n**************************************************\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFelix-Quehl%2FC_Memory_Manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFelix-Quehl%2FC_Memory_Manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFelix-Quehl%2FC_Memory_Manager/lists"}