Blender  V2.93
util_stats.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __UTIL_STATS_H__
18 #define __UTIL_STATS_H__
19 
20 #include "util/util_atomic.h"
21 #include "util/util_profiling.h"
22 
24 
25 class Stats {
26  public:
27  enum static_init_t { static_init = 0 };
28 
29  Stats() : mem_used(0), mem_peak(0)
30  {
31  }
32  explicit Stats(static_init_t)
33  {
34  }
35 
36  void mem_alloc(size_t size)
37  {
40  }
41 
42  void mem_free(size_t size)
43  {
44  assert(mem_used >= size);
46  }
47 
48  size_t mem_used;
49  size_t mem_peak;
50 };
51 
53 
54 #endif /* __UTIL_STATS_H__ */
ATOMIC_INLINE size_t atomic_add_and_fetch_z(size_t *p, size_t x)
ATOMIC_INLINE size_t atomic_sub_and_fetch_z(size_t *p, size_t x)
ATOMIC_INLINE size_t atomic_fetch_and_update_max_z(size_t *p, size_t x)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
size_t mem_used
Definition: util_stats.h:48
size_t mem_peak
Definition: util_stats.h:49
Stats(static_init_t)
Definition: util_stats.h:32
static_init_t
Definition: util_stats.h:27
@ static_init
Definition: util_stats.h:27
void mem_free(size_t size)
Definition: util_stats.h:42
void mem_alloc(size_t size)
Definition: util_stats.h:36
Stats()
Definition: util_stats.h:29
#define CCL_NAMESPACE_END