diff options
author | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
commit | 0d2d4a6d4a75ac38c41f872c88255eab70e88ab7 (patch) | |
tree | b7a7518af86dddba48e05a98b3c2be55e8804721 /intern/guardedalloc/MEM_guardedalloc.h | |
parent | 9b416c66fb714bdfd15a481489dbf650d0f389ea (diff) | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Merge branch 'master' into temp-ui-button-type-refactortemp-ui-button-type-refactor
Diffstat (limited to 'intern/guardedalloc/MEM_guardedalloc.h')
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index 55ea1d0bb70..9c62b2396f6 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -211,6 +211,10 @@ extern size_t (*MEM_get_peak_memory)(void) ATTR_WARN_UNUSED_RESULT; extern const char *(*MEM_name_ptr)(void *vmemh); #endif +/** This should be called as early as possible in the program. When it has been called, information + * about memory leaks will be printed on exit. */ +void MEM_init_memleak_detection(void); + /* Switch allocator to slower but fully guarded mode. */ void MEM_use_guarded_allocator(void); @@ -243,6 +247,11 @@ void MEM_use_guarded_allocator(void); void *operator new(size_t /*count*/, void *ptr) \ { \ return ptr; \ + } \ + /* This is the matching delete operator to the placement-new operator above. Both parameters \ + * will have the same value. Without this, we get the warning C4291 on windows. */ \ + void operator delete(void * /*ptr_to_free*/, void * /*ptr*/) \ + { \ } /* Needed when type includes a namespace, then the namespace should not be |