Skip to content

Commit 7840760

Browse files
committed
disable temporary memory by default
1 parent 1d10529 commit 7840760

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config/foundation.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[foundation]
2-
temporary_memory = 1M
2+
temporary_memory = 0
33
daemon = false
44
memory_tracker = local

foundation/memory.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ _atomic_allocate_initialize(size_t storagesize) {
8888

8989
static void
9090
_atomic_allocate_finalize(void) {
91-
if (_memory_temporary.storage)
92-
memory_deallocate(_memory_temporary.storage);
91+
void* storage = _memory_temporary.storage;
9392
memset(&_memory_temporary, 0, sizeof(_memory_temporary));
93+
if (storage)
94+
memory_deallocate(storage);
9495
}
9596

9697
static void*
@@ -179,7 +180,6 @@ _memory_preallocate(void) {
179180
void
180181
_memory_finalize(void) {
181182
memory_set_tracker(_memory_no_tracker);
182-
183183
_atomic_allocate_finalize();
184184
_memory_system.finalize();
185185
}

0 commit comments

Comments
 (0)