Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-08-21 12:35:51 +0300
committerJacques Lucke <jacques@blender.org>2020-08-21 12:49:57 +0300
commit3b93022e9213fce8b378bbc4d6ba229c2ddc849f (patch)
treee5aa9f544e84f1eb180c36d1208d36a8105cb16d /intern/guardedalloc/MEM_guardedalloc.h
parent41d31e100d9d76aa8f20bd9fe8429122828dc7a9 (diff)
Tests: detect memory leaks in automated testsfail-on-memleak
A memory leak should be considered a bug. Therefore, it makes sense to fail tests when they contain memory leaks. Differential Revision: https://developer.blender.org/D8665
Diffstat (limited to 'intern/guardedalloc/MEM_guardedalloc.h')
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 9c62b2396f6..c05bda030ad 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -215,6 +215,11 @@ extern const char *(*MEM_name_ptr)(void *vmemh);
* about memory leaks will be printed on exit. */
void MEM_init_memleak_detection(void);
+/** When this has been called and memory leaks have been detected, the process will have an exit
+ * code that indicates failure. This can be used for when checking for memory leaks with automated
+ * tests. */
+void MEM_enable_fail_on_memleak(void);
+
/* Switch allocator to slower but fully guarded mode. */
void MEM_use_guarded_allocator(void);