Loading...
common/FileManager.cpp dyld-1335 dyld-1165.3
--- dyld/dyld-1335/common/FileManager.cpp
+++ dyld/dyld-1165.3/common/FileManager.cpp
@@ -47,15 +47,13 @@
 FileManager::FileManager(Allocator& allocator, const SyscallDelegate* syscall)
 : _syscall(syscall), _allocator(&allocator), _fsUUIDMap(_allocator->makeUnique<OrderedMap<uint64_t,UUID>>(*_allocator)) {}
 
-FileManager::FileManager(Allocator& allocator)
-    : _syscall(nullptr), _allocator(&allocator), _fsUUIDMap(_allocator->makeUnique<OrderedMap<uint64_t,UUID>>(*_allocator)) {}
-
 void FileManager::swap(FileManager& other) {
     using std::swap;
 
     std::swap(_allocator,   other._allocator);
     std::swap(_fsUUIDMap,   other._fsUUIDMap);
 }
+
 
 FileRecord FileManager::fileRecordForPath(Allocator& allocator, const char* filePath) {
     const char* str = nullptr;
@@ -97,7 +95,6 @@
     } __attribute__((aligned(4), packed));
     typedef struct VolAttrBuf VolAttrBuf;
 
-    STACK_ALLOCATOR(ephemeralAllocator, 0);
     while (1) {
         int fsCount = getfsstat(nullptr, 0, MNT_NOWAIT);
         if (fsCount == -1) {
@@ -105,10 +102,10 @@
             break;
         }
         int fsInfoSize = fsCount*sizeof(struct statfs);
-        auto fsInfos = (struct statfs *)ephemeralAllocator.malloc(fsInfoSize);
+        auto fsInfos = (struct statfs *)_allocator->malloc(fsInfoSize);
         if (this->getfsstat(fsInfos, fsInfoSize, MNT_NOWAIT) != fsCount) {
             // Retry
-            ephemeralAllocator.free((void*)fsInfos);
+            _allocator->free((void*)fsInfos);
             continue;
         }
         for (auto i = 0; i < fsCount; ++i) {
@@ -141,7 +138,7 @@
                 _fsUUIDMap->insert({f_fsid, UUID()});
             }
         }
-        ephemeralAllocator.free((void*)fsInfos);
+        _allocator->free((void*)fsInfos);
         break;
     }
 }