Welcome to mirror list, hosted at ThFree Co, Russian Federation.

guarded_allocator.cpp « util « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ac238bbdd0fbfea89b7a46d7958a79f3d6d15752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "util/guarded_allocator.h"
#include "util/stats.h"

CCL_NAMESPACE_BEGIN

static Stats global_stats(Stats::static_init);

/* Internal API. */

void util_guarded_mem_alloc(size_t n)
{
  global_stats.mem_alloc(n);
}

void util_guarded_mem_free(size_t n)
{
  global_stats.mem_free(n);
}

/* Public API. */

size_t util_guarded_get_mem_used()
{
  return global_stats.mem_used;
}

size_t util_guarded_get_mem_peak()
{
  return global_stats.mem_peak;
}

CCL_NAMESPACE_END