[compiler-rt] [MemProf] Add interface for reseting the profile file descriptor (PR #73714)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 15:50:38 PST 2023


================
@@ -738,3 +738,11 @@ int __memprof_profile_dump() {
   // detected during the dumping process.
   return 0;
 }
+
+void __memprof_profile_reset() {
+  if (report_file.fd != kInvalidFd && report_file.fd != kStdoutFd &&
+      report_file.fd != kStderrFd) {
+    CloseFile(report_file.fd);
+    report_file.fd = kInvalidFd;
----------------
snehasish wrote:

Can you add a comment why we need to set this to kInvalidFd?

https://github.com/llvm/llvm-project/pull/73714


More information about the llvm-commits mailing list