Blender
V5.0
source
blender
blenlib
BLI_memory_counter.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
10
11
#include "
BLI_function_ref.hh
"
12
#include "
BLI_implicit_sharing_ptr.hh
"
13
#include "
BLI_memory_counter_fwd.hh
"
14
#include "
BLI_set.hh
"
15
16
namespace
blender::memory_counter
{
17
18
class
MemoryCount
{
19
public
:
27
int64_t
total_bytes
= 0;
28
29
Set<WeakImplicitSharingPtr>
handled_shared_data
;
30
31
void
reset
();
32
};
33
39
class
MemoryCounter
:
NonCopyable
,
NonMovable
{
40
private
:
41
MemoryCount
&count_;
42
43
public
:
44
MemoryCounter
(
MemoryCount
&
count
);
45
49
void
add
(
const
int64_t
bytes);
50
60
void
add_shared
(
const
ImplicitSharingInfo
*sharing_info,
61
const
FunctionRef
<
void
(
MemoryCounter
&shared_memory)> count_fn);
62
67
void
add_shared
(
const
ImplicitSharingInfo
*sharing_info,
const
int64_t
bytes);
68
};
69
70
}
// namespace blender::memory_counter
BLI_function_ref.hh
BLI_implicit_sharing_ptr.hh
BLI_memory_counter_fwd.hh
BLI_set.hh
int64_t
long long int int64_t
Definition
btConvexHullComputer.cpp:31
blender::FunctionRef
Definition
BLI_function_ref.hh:72
blender::ImplicitSharingInfo
Definition
BLI_implicit_sharing.hh:41
blender::NonCopyable::NonCopyable
NonCopyable(const NonCopyable &other)=delete
blender::NonMovable::NonMovable
NonMovable(NonMovable &&other)=delete
blender::Set
Definition
BLI_set.hh:106
blender::memory_counter::MemoryCount
Definition
BLI_memory_counter.hh:18
blender::memory_counter::MemoryCount::handled_shared_data
Set< WeakImplicitSharingPtr > handled_shared_data
Definition
BLI_memory_counter.hh:29
blender::memory_counter::MemoryCount::total_bytes
int64_t total_bytes
Definition
BLI_memory_counter.hh:27
blender::memory_counter::MemoryCount::reset
void reset()
Definition
memory_counter.cc:43
blender::memory_counter::MemoryCounter::add
void add(const int64_t bytes)
Definition
memory_counter.cc:15
blender::memory_counter::MemoryCounter::add_shared
void add_shared(const ImplicitSharingInfo *sharing_info, const FunctionRef< void(MemoryCounter &shared_memory)> count_fn)
blender::memory_counter::MemoryCounter::MemoryCounter
MemoryCounter(MemoryCount &count)
Definition
memory_counter.cc:13
count
int count
Definition
interface_widgets.cc:1067
blender::memory_counter
Definition
BLI_memory_counter.hh:16
Generated on
for Blender by
doxygen
1.16.1