提交 59c0ea18 编写于 作者: J Junio C Hamano

Merge branch 'jk/leak-checkers'

Many of our programs consider that it is OK to release dynamic
storage that is used throughout the life of the program by simply
exiting, but this makes it harder to leak detection tools to avoid
reporting false positives.  Plug many existing leaks and introduce
a mechanism for developers to mark that the region of memory
pointed by a pointer is not lost/leaking to help these tools.

* jk/leak-checkers:
  git-compat-util: make UNLEAK less error-prone
......@@ -1184,9 +1184,9 @@ extern int cmd_main(int, const char **);
*/
#ifdef SUPPRESS_ANNOTATED_LEAKS
extern void unleak_memory(const void *ptr, size_t len);
#define UNLEAK(var) unleak_memory(&(var), sizeof(var));
#define UNLEAK(var) unleak_memory(&(var), sizeof(var))
#else
#define UNLEAK(var)
#define UNLEAK(var) do {} while (0)
#endif
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册