[MemInit] Remove old API, introduce new MemInit API.
Introduces new heap-zero-init API. We've realised that it's better to be
able to individually control MTE and heap zero-init. Having
heap-zero-init not be controllable without affecting MTE affects our
ability to turn off heap-zero-init in zygote-forked applications.
Bug: 135772972
Test: On FVP: atest -s localhost:5555 malloc#zero_init \
Test: malloc#disable_mte heap_tagging_level
Change-Id: I8c6722502733259934c699f4f1269eaf1641a09f
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp
index 863103d..c91efa0 100644
--- a/libc/bionic/malloc_common.cpp
+++ b/libc/bionic/malloc_common.cpp
@@ -44,10 +44,10 @@
#include "gwp_asan_wrappers.h"
#include "heap_tagging.h"
+#include "heap_zero_init.h"
#include "malloc_common.h"
#include "malloc_limit.h"
#include "malloc_tagged_pointers.h"
-#include "memory_mitigation_state.h"
// =============================================================================
// Global variables instantations.
@@ -107,8 +107,8 @@
ScopedPthreadMutexLocker locker(&g_heap_tagging_lock);
return SetHeapTaggingLevel(static_cast<HeapTaggingLevel>(value));
}
- if (param == M_BIONIC_DISABLE_MEMORY_MITIGATIONS) {
- return DisableMemoryMitigations(value);
+ if (param == M_BIONIC_ZERO_INIT) {
+ return SetHeapZeroInitialize(value);
}
// The rest we pass on...
auto dispatch_table = GetDispatchTable();