diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-12-04 10:14:38 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-04 10:14:40 +0900 |
| commit | a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82 (patch) | |
| tree | cac04682f84642083987a06d1c2ae6ebcf8e4a38 /git-compat-util.h | |
| parent | Merge branch 'ps/gc-stale-lock-warning' (diff) | |
| parent | t: remove TEST_PASSES_SANITIZE_LEAK annotations (diff) | |
| download | git-a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82.tar.gz git-a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82.zip | |
Merge branch 'ps/leakfixes-part-10'
Leakfixes.
* ps/leakfixes-part-10: (27 commits)
t: remove TEST_PASSES_SANITIZE_LEAK annotations
test-lib: unconditionally enable leak checking
t: remove unneeded !SANITIZE_LEAK prerequisites
t: mark some tests as leak free
t5601: work around leak sanitizer issue
git-compat-util: drop now-unused `UNLEAK()` macro
global: drop `UNLEAK()` annotation
t/helper: fix leaking commit graph in "read-graph" subcommand
builtin/branch: fix leaking sorting options
builtin/init-db: fix leaking directory paths
builtin/help: fix leaks in `check_git_cmd()`
help: fix leaking return value from `help_unknown_cmd()`
help: fix leaking `struct cmdnames`
help: refactor to not use globals for reading config
builtin/sparse-checkout: fix leaking sanitized patterns
split-index: fix memory leak in `move_cache_to_base_index()`
git: refactor builtin handling to use a `struct strvec`
git: refactor alias handling to use a `struct strvec`
strvec: introduce new `strvec_splice()` function
line-log: fix leak when rewriting commit parents
...
Diffstat (limited to 'git-compat-util.h')
| -rw-r--r-- | git-compat-util.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index e4a306dd56..a06d4f3809 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -1527,26 +1527,6 @@ int cmd_main(int, const char **); int common_exit(const char *file, int line, int code); #define exit(code) exit(common_exit(__FILE__, __LINE__, (code))) -/* - * You can mark a stack variable with UNLEAK(var) to avoid it being - * reported as a leak by tools like LSAN or valgrind. The argument - * should generally be the variable itself (not its address and not what - * it points to). It's safe to use this on pointers which may already - * have been freed, or on pointers which may still be in use. - * - * Use this _only_ for a variable that leaks by going out of scope at - * program exit (so only from cmd_* functions or their direct helpers). - * Normal functions, especially those which may be called multiple - * times, should actually free their memory. This is only meant as - * an annotation, and does nothing in non-leak-checking builds. - */ -#ifdef SUPPRESS_ANNOTATED_LEAKS -void unleak_memory(const void *ptr, size_t len); -#define UNLEAK(var) unleak_memory(&(var), sizeof(var)) -#else -#define UNLEAK(var) do {} while (0) -#endif - #define z_const #include <zlib.h> |
