Optimize to return memory when using -build (#6192) (#6226).

This commit is contained in:
Wilson Snyder
2025-07-24 08:36:58 +02:00
parent db5b2669fc
commit 2287d420ee
8 changed files with 49 additions and 1 deletions
+13
View File
@@ -54,6 +54,10 @@ VL_DEFINE_DEBUG_FUNCTIONS;
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_TCMALLOC
#include <gperftools/malloc_extension.h>
#endif
// clang-format off
#if defined(_WIN32) || defined(__MINGW32__)
# include <windows.h> // LONG for bcrypt.h on MINGW
@@ -402,6 +406,15 @@ void V3Os::unlinkRegexp(const string& dir, const string& regexp) {
#endif
}
//######################################################################
// METHODS (memory)
void V3Os::releaseMemory() {
#ifdef HAVE_TCMALLOC
MallocExtension::instance()->ReleaseFreeMemory();
#endif
}
//######################################################################
// METHODS (random)