Blender V5.0
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
6#include "util/stats.h"
7
9
11
12/* Internal API. */
13
14void util_guarded_mem_alloc(const size_t n)
15{
16 global_stats.mem_alloc(n);
17}
18
19void util_guarded_mem_free(const size_t n)
20{
21 global_stats.mem_free(n);
22}
23
24/* Public API. */
25
27{
28 return global_stats.mem_used;
29}
30
32{
33 return global_stats.mem_peak;
34}
35
@ static_init
Definition util/stats.h:13
#define CCL_NAMESPACE_END
size_t util_guarded_get_mem_used()
size_t util_guarded_get_mem_peak()
void util_guarded_mem_alloc(const size_t n)
static CCL_NAMESPACE_BEGIN Stats global_stats(Stats::static_init)
void util_guarded_mem_free(const size_t n)