File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,9 @@ vector<string> g_searchPaths;
132132
133133void VulkanCleanup ();
134134
135+ // /@brief List of handlers for low memory registered by various subsystems
136+ set<MemoryPressureHandler> g_memoryPressureHandlers;
137+
135138/* *
136139 @brief Static initialization for SCPI transports
137140 */
@@ -996,6 +999,11 @@ const char* ScopehalGetVersion()
996999 */
9971000void OnMemoryPressure (MemoryPressureLevel level, MemoryPressureType type)
9981001{
1002+ LogWarning (" OnMemoryPressure: %s memory exhaustion on %s\n " ,
1003+ (level == MemoryPressureLevel::Hard) ? " Hard" : " Soft" ,
1004+ (type == MemoryPressureType::Host) ? " host" : " device" );
1005+ LogIndenter li;
1006+
9991007 for (auto handler : g_memoryPressureHandlers)
10001008 handler (level, type);
10011009}
Original file line number Diff line number Diff line change @@ -302,8 +302,7 @@ enum class MemoryPressureType
302302// /@brief Memory pressure handler type, called when free memory reaches a warning level or a Vulkan allocation fails
303303typedef void (*MemoryPressureHandler)(MemoryPressureLevel level, MemoryPressureType type);
304304
305- // /@brief List of handlers for low memory registered by various subsystems
306- std::set<MemoryPressureHandler> g_memoryPressureHandlers;
305+ extern std::set<MemoryPressureHandler> g_memoryPressureHandlers;
307306
308307void OnMemoryPressure (MemoryPressureLevel level, MemoryPressureType type);
309308
You can’t perform that action at this time.
0 commit comments