Add malloc_trim after builtin_builder release.
authorSungguk Na <sungguk.na@samsung.com>
Mon, 10 Aug 2020 06:16:05 +0000 (15:16 +0900)
committerXuelian Bai <xuelian.bai@samsung.com>
Tue, 21 Feb 2023 06:32:52 +0000 (14:32 +0800)
Memory usage pattern of Built-in builder causes large size chunk pools by glibc pool management scheme.
It is not useful ,but just unnecessary expense.
so malloc_trim will help to reduce memory usage in this case.

Change-Id: Ia63fb2050b468e55cd6b740b6a26585ed8e824a5
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
src/compiler/glsl/builtin_functions.cpp

index 84618dd..7cbf210 100644 (file)
@@ -82,6 +82,7 @@
 #include "glsl_parser_extras.h"
 #include "program/prog_instruction.h"
 #include <math.h>
+#include <malloc.h>
 #include "builtin_functions.h"
 #include "util/hash_table.h"
 
@@ -1449,6 +1450,7 @@ builtin_builder::release()
    shader = NULL;
 
    glsl_type_singleton_decref();
+   malloc_trim(0);
 }
 
 void