Loading...
common/FileManager.cpp dyld-1162 dyld-1245.1
--- dyld/dyld-1162/common/FileManager.cpp
+++ dyld/dyld-1245.1/common/FileManager.cpp
@@ -95,6 +95,7 @@
     } __attribute__((aligned(4), packed));
     typedef struct VolAttrBuf VolAttrBuf;
 
+    STACK_ALLOCATOR(ephemeralAllocator, 0);
     while (1) {
         int fsCount = getfsstat(nullptr, 0, MNT_NOWAIT);
         if (fsCount == -1) {
@@ -102,10 +103,10 @@
             break;
         }
         int fsInfoSize = fsCount*sizeof(struct statfs);
-        auto fsInfos = (struct statfs *)_allocator->malloc(fsInfoSize);
+        auto fsInfos = (struct statfs *)ephemeralAllocator.malloc(fsInfoSize);
         if (this->getfsstat(fsInfos, fsInfoSize, MNT_NOWAIT) != fsCount) {
             // Retry
-            _allocator->free((void*)fsInfos);
+            ephemeralAllocator.free((void*)fsInfos);
             continue;
         }
         for (auto i = 0; i < fsCount; ++i) {
@@ -138,7 +139,7 @@
                 _fsUUIDMap->insert({f_fsid, UUID()});
             }
         }
-        _allocator->free((void*)fsInfos);
+        ephemeralAllocator.free((void*)fsInfos);
         break;
     }
 }