{"id":17801019,"url":"https://github.com/refi64/noleak","last_synced_at":"2025-10-07T01:05:01.345Z","repository":{"id":19546551,"uuid":"22794954","full_name":"refi64/noleak","owner":"refi64","description":"An easy-to-use leak detector for C and C++","archived":false,"fork":false,"pushed_at":"2014-08-09T22:11:34.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T05:06:47.106Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/refi64.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-09T20:52:17.000Z","updated_at":"2018-05-12T21:30:53.000Z","dependencies_parsed_at":"2022-08-21T12:11:01.948Z","dependency_job_id":null,"html_url":"https://github.com/refi64/noleak","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fnoleak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fnoleak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fnoleak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fnoleak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/noleak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758278,"owners_count":20828919,"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":[],"created_at":"2024-10-27T12:33:10.746Z","updated_at":"2025-10-07T01:04:56.306Z","avatar_url":"https://github.com/refi64.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"NoLeak\n======\n\nNoLeak is an easy-use leak detector for C and C++ programs.\n\nBuilding\n********\n\nThe build files are generated using `Bakefile \u003chttp://bakefile.org/\u003e`_. Unix users can just run `make`. Visual Studio users will find a solution file under `vsproj/\u003cversion\u003e/noleak.sln`, replacing `\u003cversion\u003e` with your Visual Studio version. For instance, VS 2012 users would open `vsproj/2012/noleak.sln`.\n\nC usage\n*******\n\nReplace calls to `malloc` with `NL_MALLOC`, calls to `free` with `NL_FREE`, calls to `calloc` with `NL_CALLOC`, and calls to `realloc` with `NL_REALLOC`. Then, call `noleak_init()` at the start of your program's main function and include `noleak.h` at the top of the file. For example, change this:\n\n.. code:: c\n   \n   int main()\n   {\n       int* p = malloc(4);\n       ...\n       // forget to free p\n       return 0;\n   }\n\nto this:\n\n.. code:: c\n   \n   #include \u003cnoleak.h\u003e\n   \n   int main()\n   {\n       noleak_init();\n       int* p = NL_MALLOC(4);\n       ...\n       return 0;\n   }\n\nNow, all memory leaks will be printed on program exit. The program's output will look like this::\n   \n   Leak #1 at test.c:main:6\n   Total leaks: 1\n\nC++ usage\n*********\n\nWith C++, replace calls to `new` with `new (NOLEAK)` and again include `noleak.h`. For instance:\n\n.. code:: c++\n   \n   #include \u003cnoleak.h\u003e\n   \n   int main()\n   {\n       int* p = new (NOLEAK) int;\n       // forget to delete p\n       return 0;\n   }\n\nThere's no need to replace `delete` calls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fnoleak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Fnoleak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fnoleak/lists"}