Loading...
libkern/c++/OSRuntime.cpp xnu-12377.101.15 xnu-8019.61.5
--- xnu/xnu-12377.101.15/libkern/c++/OSRuntime.cpp
+++ xnu/xnu-8019.61.5/libkern/c++/OSRuntime.cpp
@@ -55,10 +55,6 @@
 #include <san/kasan.h>
 #endif
 
-#if CONFIG_SPTM
-#include <arm64/sptm/sptm.h>
-#endif
-
 #if PRAGMA_MARK
 #pragma mark Constants &c.
 #endif /* PRAGMA_MARK */
@@ -112,9 +108,6 @@
 
 extern lck_grp_t * IOLockGroup;
 extern kmod_info_t g_kernel_kmod_info;
-#if CONFIG_SPTM
-extern kmod_info_t g_sptm_kmod_info, g_txm_kmod_info;
-#endif /* CONFIG_SPTM */
 
 enum {
 	kOSSectionNamesDefault     = 0,
@@ -140,11 +133,6 @@
 	OSMetaClassBase::initialize();
 
 	g_kernel_kmod_info.address = (vm_address_t) &_mh_execute_header;
-#if CONFIG_SPTM
-	g_sptm_kmod_info.address = (vm_offset_t)SPTMArgs->debug_header->image[DEBUG_HEADER_ENTRY_SPTM];
-	g_txm_kmod_info.address = (vm_offset_t)SPTMArgs->debug_header->image[DEBUG_HEADER_ENTRY_TXM];
-#endif /* CONFIG_SPTM */
-
 	if (kOSReturnSuccess != OSRuntimeInitializeCPP(NULL)) {
 		// &g_kernel_kmod_info, gOSSectionNamesStandard, 0, 0)) {
 		panic("OSRuntime: C++ runtime failed to initialize.");
@@ -561,14 +549,12 @@
 /*********************************************************************
 * C++ Allocators & Deallocators
 *********************************************************************/
-__typed_allocators_ignore_push
-
 void *
 operator new(size_t size)
 {
 	assert(size);
-	return kheap_alloc(KERN_OS_MALLOC, size,
-	           Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
+	return kheap_alloc_tag_bt(KERN_OS_MALLOC, size,
+	           (zalloc_flags_t) (Z_WAITOK | Z_ZERO), VM_KERN_MEMORY_LIBKERN);
 }
 
 void
@@ -582,10 +568,10 @@
 }
 
 void *
-operator new[](unsigned long size)
-{
-	return kheap_alloc(KERN_OS_MALLOC, size,
-	           Z_VM_TAG_BT(Z_WAITOK_ZERO, VM_KERN_MEMORY_LIBKERN));
+operator new[](unsigned long sz)
+{
+	return kheap_alloc_tag_bt(KERN_OS_MALLOC, sz,
+	           (zalloc_flags_t) (Z_WAITOK | Z_ZERO), VM_KERN_MEMORY_LIBKERN);
 }
 
 void
@@ -622,8 +608,6 @@
 		kheap_free(KERN_OS_MALLOC, addr, sz);
 	}
 }
-
-__typed_allocators_ignore_pop
 
 #endif /* __cplusplus >= 201103L */