diff options
-rw-r--r-- | intern/cycles/util/util_guarded_allocator.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/util/util_stats.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/util/util_guarded_allocator.cpp b/intern/cycles/util/util_guarded_allocator.cpp index 8de6e254cbf..615ac95f324 100644 --- a/intern/cycles/util/util_guarded_allocator.cpp +++ b/intern/cycles/util/util_guarded_allocator.cpp @@ -19,7 +19,7 @@ CCL_NAMESPACE_BEGIN -static Stats global_stats; +static Stats global_stats(Stats::static_init); /* Internal API. */ diff --git a/intern/cycles/util/util_stats.h b/intern/cycles/util/util_stats.h index ce27067dc5e..b970b017270 100644 --- a/intern/cycles/util/util_stats.h +++ b/intern/cycles/util/util_stats.h @@ -23,7 +23,10 @@ CCL_NAMESPACE_BEGIN class Stats { public: + enum static_init_t { static_init = 0 }; + Stats() : mem_used(0), mem_peak(0) {} + explicit Stats(static_init_t) {} void mem_alloc(size_t size) { atomic_add_z(&mem_used, size); |