mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
Memory leak reported for long string debug variables in ULTs
This commit eliminates ULTs memory leaks reported for string debug variables exceeding small string optimization size by calling shrink_to_fit() method on string debug variables in DebugManagerStateRestore destructor. Change-Id: I304c5c5c23c80f01fdf13f38cea5b4eceb18a94f Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include "runtime/helpers/file_io.h"
|
||||
#include "runtime/helpers/string_helpers.h"
|
||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
#include "runtime/utilities/directory.h"
|
||||
#include "unit_tests/mocks/mock_kernel.h"
|
||||
@@ -941,3 +942,8 @@ TEST(DebugSettingsManager, givenTwoPossibleVariantsOfHardwareInfoOverrideStringT
|
||||
debugManager.getHardwareInfoOverride(hwInfoConfig);
|
||||
EXPECT_EQ(str1, hwInfoConfig);
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenStringDebugVariableWhenLongValueExeedingSmallStringOptimizationIsAssignedThenMemoryLeakIsNotReported) {
|
||||
DebugManagerStateRestore debugManagerStateRestore;
|
||||
DebugManager.flags.AUBDumpCaptureFileName.set("ThisIsVeryLongStringValueThatExceedSizeSpecifiedBySmallStringOptimizationAndCausesInternalStringBufferResize");
|
||||
}
|
||||
Reference in New Issue
Block a user