Skip to content

Commit e37c626

Browse files
committed
Merge pull request #105767 from Ivorforce/no-alloc-count
Optimize static allocations by removing unused `Memory::alloc_count`.
2 parents 49646e1 + af76105 commit e37c626

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

core/os/memory.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ SafeNumeric<uint64_t> Memory::mem_usage;
6262
SafeNumeric<uint64_t> Memory::max_usage;
6363
#endif
6464

65-
SafeNumeric<uint64_t> Memory::alloc_count;
66-
6765
void *Memory::alloc_aligned_static(size_t p_bytes, size_t p_alignment) {
6866
DEV_ASSERT(is_power_of_2(p_alignment));
6967

@@ -107,8 +105,6 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
107105

108106
ERR_FAIL_NULL_V(mem, nullptr);
109107

110-
alloc_count.increment();
111-
112108
if (prepad) {
113109
uint8_t *s8 = (uint8_t *)mem;
114110

@@ -186,8 +182,6 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) {
186182
bool prepad = p_pad_align;
187183
#endif
188184

189-
alloc_count.decrement();
190-
191185
if (prepad) {
192186
mem -= DATA_OFFSET;
193187

core/os/memory.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class Memory {
4343
static SafeNumeric<uint64_t> max_usage;
4444
#endif
4545

46-
static SafeNumeric<uint64_t> alloc_count;
47-
4846
public:
4947
// Alignment: ↓ max_align_t ↓ uint64_t ↓ max_align_t
5048
// ┌─────────────────┬──┬────────────────┬──┬───────────...

0 commit comments

Comments
 (0)