| Flutter Impeller |

Public Member Functions | List of all members
impeller::DebugAllocatorStats Class Reference

`#include <allocator_mtl.h>`

## Public Member Functions
| DebugAllocatorStats ()
| ~DebugAllocatorStats ()
void | Increment (size_t size)
| Increment the tracked allocation size in bytes. More...
void | Decrement (size_t size)
| Decrement the tracked allocation size in bytes. More...
size_t | GetAllocationSizeMB ()
| Get the current tracked allocation size in MB. More...

## Detailed Description

Definition at line 16 of file allocator_mtl.h.

## Constructor & Destructor Documentation

## ◆ DebugAllocatorStats()

impeller::DebugAllocatorStats::DebugAllocatorStats | ( |  | ) |
| inline

Definition at line 18 of file allocator_mtl.h.

18 {}

## ◆ ~DebugAllocatorStats()

impeller::DebugAllocatorStats::~DebugAllocatorStats | ( |  | ) |
| inline

Definition at line 20 of file allocator_mtl.h.

20 {}

## Member Function Documentation

## ◆ Decrement()

void impeller::DebugAllocatorStats::Decrement | ( | size_t | size | ) |

Decrement the tracked allocation size in bytes.

Definition at line 97 of file allocator_mtl.mm.

97 {
98 size_.fetch_sub(size, std::memory_order_relaxed);
99 }

## ◆ GetAllocationSizeMB()

size_t impeller::DebugAllocatorStats::GetAllocationSizeMB | ( |  | ) |

Get the current tracked allocation size in MB.

Definition at line 101 of file allocator_mtl.mm.

101 {
102 // RAM is measured in MiB, thus a divisor of 2^20 instead of 1,000,000.
103 size_t new_value = size_ / (1024 * 1024);
104 return new_value;
105 }

## ◆ Increment()

void impeller::DebugAllocatorStats::Increment | ( | size_t | size | ) |

Increment the tracked allocation size in bytes.

Definition at line 93 of file allocator_mtl.mm.

93 {
94 size_.fetch_add(size, std::memory_order_relaxed);
95 }

The documentation for this class was generated from the following files:

- impeller/renderer/backend/metal/allocator_mtl.h
- impeller/renderer/backend/metal/allocator_mtl.mm