From 23998b752b409a86e5dc03d8d47b9369419f0b72 Mon Sep 17 00:00:00 2001 From: chenjian Date: Thu, 8 Sep 2022 20:27:05 +0800 Subject: [PATCH] fix warning (#45870) --- paddle/fluid/memory/allocation/system_allocator.cc | 7 +++---- paddle/fluid/platform/profiler/chrometracing_logger.cc | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/memory/allocation/system_allocator.cc b/paddle/fluid/memory/allocation/system_allocator.cc index fcfece978c..15cd2f6d1f 100644 --- a/paddle/fluid/memory/allocation/system_allocator.cc +++ b/paddle/fluid/memory/allocation/system_allocator.cc @@ -111,15 +111,14 @@ void CPUAllocator::Free(void* p, size_t size, size_t index) { munlock(p, size); #endif } + HOST_MEMORY_STAT_UPDATE(Reserved, 0, -size); + platform::RecordMemEvent( + p, CPUPlace(), size, platform::TracerMemEventType::ReservedFree); #ifdef _WIN32 _aligned_free(p); #else free(p); #endif - - HOST_MEMORY_STAT_UPDATE(Reserved, 0, -size); - platform::RecordMemEvent( - p, CPUPlace(), size, platform::TracerMemEventType::ReservedFree); } bool CPUAllocator::UseGpu() const { return false; } diff --git a/paddle/fluid/platform/profiler/chrometracing_logger.cc b/paddle/fluid/platform/profiler/chrometracing_logger.cc index 1e22ffe1a8..287628c85e 100644 --- a/paddle/fluid/platform/profiler/chrometracing_logger.cc +++ b/paddle/fluid/platform/profiler/chrometracing_logger.cc @@ -546,10 +546,10 @@ void ChromeTracingLogger::HandleTypeMemset( } void ChromeTracingLogger::StartLog() { - output_file_stream_ << string_format(std::string( + output_file_stream_ << std::string( R"JSON( { - "displayTimeUnit": "ms",)JSON")); + "displayTimeUnit": "ms",)JSON"); } void ChromeTracingLogger::LogMetaInfo(const std::string& version, -- GitLab