{"id":28200733,"url":"https://github.com/9inefold/suiveur","last_synced_at":"2025-06-12T17:30:48.693Z","repository":{"id":137761341,"uuid":"600653976","full_name":"9inefold/suiveur","owner":"9inefold","description":"An experimental memory tracking library for c++17","archived":false,"fork":false,"pushed_at":"2023-03-10T04:49:01.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-16T21:15:42.274Z","etag":null,"topics":["cpp17","memory-tracking","metaprogramming"],"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/9inefold.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-12T06:37:55.000Z","updated_at":"2024-10-05T19:58:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"e57f0a6b-7bdf-4948-ab3b-015afcd3920a","html_url":"https://github.com/9inefold/suiveur","commit_stats":null,"previous_names":["9inefold/suiveur"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/9inefold/suiveur","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9inefold%2Fsuiveur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9inefold%2Fsuiveur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9inefold%2Fsuiveur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9inefold%2Fsuiveur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9inefold","download_url":"https://codeload.github.com/9inefold/suiveur/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9inefold%2Fsuiveur/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259511971,"owners_count":22869319,"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":["cpp17","memory-tracking","metaprogramming"],"created_at":"2025-05-16T21:16:35.260Z","updated_at":"2025-06-12T17:30:48.687Z","avatar_url":"https://github.com/9inefold.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# suiveur\nThis library builds on ideas from \n[Angi Yaghi's](https://github.com/ange-yaghi) memory tracker.\nIt provides several utilities to track the use of raw pointers, \nprinting \"rust style\" errors when used incorrectly.\nThis allows you to use unsafe allocation \nwithout worrying about incorrect usage.\n\n## Example usage\n```cpp\nint* iptr = REGISTER_ALLOC(new int { 77 });\nfloat* fptr = REGISTER_ALLOC(new float { 6.9f });\ndouble* dptr = new double { 5.5 };  // untracked\n\n/* double free */\nSAFE_DELETE(iptr);\nSAFE_DELETE(iptr);\n/* free of punned pointer */\nSAFE_DELETE((char*)fptr);\n/* free of untracked pointer */\nSAFE_DELETE(dptr);\n```\n\n## Docs\n### Functions\nSuiveur defines several macros that can be used for tracking:\n```cpp\nT* REGISTER_ALLOC(T*);\nT* REGISTER_DELETE(T*);\nT* SAFE_DELETE(T*);\n\nvoid RESET_REGISTRY();\nvoid PASS_REGISTRY();\n```\n\n``REGISTER_ALLOC`` and ``REGISTER_DELETE`` will add/remove pointers from the tracking list.\nUsing ``REGISTER_DELETE`` will not error on invalid usage.\n\nOn the other hand, ``SAFE_DELETE`` will. It will warn you when you attempt\nto delete an untracked pointer, when you free a pointer multiple times, or when\nyou free a pointer that has been punned.\n\n``RESET_REGISTRY`` will completely wipe the list of tracked pointers,\nprinting any errors that have occured. If any pointers have not been freed at\nthe point of calling, they will be considered unfreed.\n\n``PASS_REGISTRY`` will just wipe the\nlist of deleted pointers, meaning it will not be able to detect things such \nas double frees for previously tracked pointers. It will not warn you about\npointers that are still unfreed.\n\n### Cmake\nSuiveur also provides 2 cmake settings: ``enable_tracking`` and ``disable_ansi``.\nThe former will turn on tracking, the functions are noops otherwise. \nThe latter will turn off colored printing, as certain consoles do not support\nansi escape codes. Both are ``OFF`` by default.\n\n## Notes\nBecause this library was originally made to track AST nodes (single objects),\nthe tracking of ``new[]`` is currently unsupported. Attempting to use it\n*will* result in UB. Support may be added in the future, but it would probably\nbe better for you to just use a ``std::vector`` or a ``std::unique_ptr``.\n\nBig thanks to [Rald](https://github.com/smartel99) for coming up with the name :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9inefold%2Fsuiveur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9inefold%2Fsuiveur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9inefold%2Fsuiveur/lists"}