Loading...
common/FileManager.cpp dyld-1235.2 dyld-1122.1
--- dyld/dyld-1235.2/common/FileManager.cpp
+++ dyld/dyld-1122.1/common/FileManager.cpp
@@ -56,9 +56,7 @@
 
 
 FileRecord FileManager::fileRecordForPath(Allocator& allocator, const char* filePath) {
-    const char* str = nullptr;
-    if ( filePath )
-        str = allocator.strdup(filePath);
+    auto str = allocator.strdup(filePath);
     return FileRecord(*this, UniquePtr<const char>(str));
 }
 
@@ -95,7 +93,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) {
@@ -103,10 +100,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) {
@@ -139,7 +136,7 @@
                 _fsUUIDMap->insert({f_fsid, UUID()});
             }
         }
-        ephemeralAllocator.free((void*)fsInfos);
+        _allocator->free((void*)fsInfos);
         break;
     }
 }