From 20af567033dedea15abb22fb7d344d116d7b99c5 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 6 Aug 2020 17:15:55 -0400 Subject: Emit spir-v using MemoryArena to stop memory leak (#1479) * Use m_style for OSFindFilesResult * Refactor of FindFilesResult. * Fixes on linux for FindFiles. * Simplify FindFilesState, and linux support for pattern matching. * Small fixes to linux FindFilesState * Fix typo on linux FindFiles * Fix typo in linux FindFiles. * Renamed some variables, and improved comments on FindFiles. * Improve comments on FildFiles * Small improvements around FindFiles. * Refactor FindFiles again.. into a visitor and function in Path. * Fix some problems on linux. * Fix linux typo. * Renamed os -> find-file-util * find-file-utl -> directory-util * Make delete of PathInfo explicit. * Initialize alwaysCreateCollectedParam . * WIP spir-v emit using MemoryArena * Fix bug in spirv emit. * Fix bug with handling null termination on strings in spirv emit. * Small improvements in comments around emit spirv * Remove the 'dst' from emitOperand - we can only emit to the current inst. * Improve SpirV emit comments. * Don't store the created instruction in the InstConstructScope - as it's always the m_currentInst. Don't return the instruction after _beginInst. Slight comment improvements. --- source/slang/slang-file-system.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-file-system.cpp') diff --git a/source/slang/slang-file-system.cpp b/source/slang/slang-file-system.cpp index ebe1eeb61..d3d1fd9f5 100644 --- a/source/slang/slang-file-system.cpp +++ b/source/slang/slang-file-system.cpp @@ -210,7 +210,8 @@ CacheFileSystem::~CacheFileSystem() { for (const auto& pair : m_uniqueIdentityMap) { - delete pair.Value; + PathInfo* pathInfo = pair.Value; + delete pathInfo; } } @@ -261,7 +262,8 @@ void CacheFileSystem::clearCache() { for (const auto& pair : m_uniqueIdentityMap) { - delete pair.Value; + PathInfo* pathInfo = pair.Value; + delete pathInfo; } m_uniqueIdentityMap.Clear(); -- cgit v1.2.3