GCC 20 memory optimization broke the memory leak for testing.
Fixes:https://tracker.ceph.com/issues/57165
Signed-off-by: Nitzan Mordechai <nmordec@redhat.com>
}
}
+#pragma GCC push_options
+#pragma GCC optimize ("O0")
+static void leak_some_memory() {
+ volatile char *foo = new char[1234];
+ (void)foo;
+}
+#pragma GCC pop_options
+
int CephContext::_do_command(
std::string_view command, const cmdmap_t& cmdmap,
Formatter *f,
}
}
if (command == "leak_some_memory") {
- char *foo = new char[1234];
- (void)foo;
+ leak_some_memory();
}
else if (command == "perfcounters_dump" || command == "1" ||
command == "perf dump") {