Loading...
--- dyld/dyld-1284.13/common/Array.h
+++ dyld/dyld-1162/common/Array.h
@@ -25,8 +25,6 @@
#define Array_h
#include <algorithm>
-#include <span>
-
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
@@ -36,7 +34,6 @@
#if !TARGET_OS_EXCLAVEKIT
#include <mach/mach.h>
#endif
-
#include "Allocator.h"
namespace dyld3 {
@@ -69,10 +66,8 @@
void pop_back() { assert(_usedCount > 0); _usedCount--; }
T* begin() { return &_elements[0]; }
T* end() { return &_elements[_usedCount]; }
- T* data() { return &_elements[0]; }
const T* begin() const { return &_elements[0]; }
const T* end() const { return &_elements[_usedCount]; }
- const T* data() const { return &_elements[0]; }
const Array<T> subArray(uint64_t start, uint64_t size) const { assert(start+size <= _usedCount);
return Array<T>(&_elements[start], size, size); }
bool contains(const T& targ) const { for (const T& a : *this) { if ( a == targ ) return true; } return false; }
@@ -140,12 +135,6 @@
this->_usedCount = n;
}
- T& operator[](uint64_t idx) {
- if ( idx >= this->_usedCount )
- resize(idx + 1);
- return this->_elements[idx];
- }
-
protected:
void growTo(uint64_t n);
void verifySpace(uint64_t n) { if (this->_usedCount+n > this->_allocCount) growTo(this->_usedCount + n); }
@@ -170,7 +159,7 @@
// MAXCOUNT is not specified, keep doubling size
_overflowBufferSize = round_page(std::max(this->_allocCount * 2, n) * sizeof(T));
}
-#if !DYLD_FEATURE_EMBEDDED_PAGE_ALLOCATOR
+#if !TARGET_OS_EXCLAVEKIT
int kr = ::vm_allocate(mach_task_self(), (vm_address_t*)&_overflowBuffer, (vm_size_t)_overflowBufferSize, VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_DYLD));
#else
_overflowBuffer = lsl::MemoryManager::allocate_pages(_overflowBufferSize);
@@ -202,7 +191,7 @@
this->_allocCount = _overflowBufferSize / sizeof(T);
if ( oldBuffer != 0 )
-#if !DYLD_FEATURE_EMBEDDED_PAGE_ALLOCATOR
+#if !TARGET_OS_EXCLAVEKIT
::vm_deallocate(mach_task_self(), (vm_address_t)oldBuffer, (vm_size_t)oldBufferSize);
#else
lsl::MemoryManager::deallocate_pages(oldBuffer, oldBufferSize);
@@ -226,7 +215,7 @@
clear();
if ( _overflowBuffer != 0 )
-#if !DYLD_FEATURE_EMBEDDED_PAGE_ALLOCATOR
+#if !TARGET_OS_EXCLAVEKIT
::vm_deallocate(mach_task_self(), (vm_address_t)_overflowBuffer, (vm_size_t)_overflowBufferSize);
#else
lsl::MemoryManager::deallocate_pages(_overflowBuffer, _overflowBufferSize);
@@ -241,7 +230,7 @@
// Free our buffer if we have one
if ( _overflowBuffer != 0 )
-#if !DYLD_FEATURE_EMBEDDED_PAGE_ALLOCATOR
+#if !TARGET_OS_EXCLAVEKIT
vm_deallocate(mach_task_self(), (vm_address_t)_overflowBuffer, (vm_size_t)_overflowBufferSize);
#else
lsl::MemoryManager::deallocate_pages(_overflowBuffer, _overflowBufferSize);