Blender
V5.0
intern
cycles
util
guarded_allocator.cpp
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#include "
util/guarded_allocator.h
"
6
#include "
util/stats.h
"
7
8
CCL_NAMESPACE_BEGIN
9
10
static
Stats
global_stats
(
Stats::static_init
);
11
12
/* Internal API. */
13
14
void
util_guarded_mem_alloc
(
const
size_t
n)
15
{
16
global_stats
.mem_alloc(n);
17
}
18
19
void
util_guarded_mem_free
(
const
size_t
n)
20
{
21
global_stats
.mem_free(n);
22
}
23
24
/* Public API. */
25
26
size_t
util_guarded_get_mem_used
()
27
{
28
return
global_stats
.mem_used;
29
}
30
31
size_t
util_guarded_get_mem_peak
()
32
{
33
return
global_stats
.mem_peak;
34
}
35
36
CCL_NAMESPACE_END
Stats
Definition
util/stats.h:11
Stats::static_init
@ static_init
Definition
util/stats.h:13
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
util_guarded_get_mem_used
size_t util_guarded_get_mem_used()
Definition
guarded_allocator.cpp:26
util_guarded_get_mem_peak
size_t util_guarded_get_mem_peak()
Definition
guarded_allocator.cpp:31
util_guarded_mem_alloc
void util_guarded_mem_alloc(const size_t n)
Definition
guarded_allocator.cpp:14
global_stats
static CCL_NAMESPACE_BEGIN Stats global_stats(Stats::static_init)
util_guarded_mem_free
void util_guarded_mem_free(const size_t n)
Definition
guarded_allocator.cpp:19
guarded_allocator.h
CCL_NAMESPACE_BEGIN
Definition
python.cpp:37
stats.h
Generated on
for Blender by
doxygen
1.16.1