using_libc_allocator = !!memcmp(&mi1, &mi2, sizeof(mi1));
}
+
+static int is_trim_enabled(void)
+{
+ return using_libc_allocator;
+}
#else
static void trim_all_pools(void)
static void detect_allocator(void)
{
}
+
+static int is_trim_enabled(void)
+{
+ return 0;
+}
#endif
/* Try to find an existing shared pool with the same characteristics and
INITCALL0(STG_PREPARE, init_pools);
+/* Report in build options if trim is supported */
+static void pools_register_build_options(void)
+{
+ if (is_trim_enabled()) {
+ char *ptr = NULL;
+ memprintf(&ptr, "Support for malloc_trim() is enabled.");
+ hap_register_build_opts(ptr, 1);
+ }
+}
+INITCALL0(STG_REGISTER, pools_register_build_options);
+
/* register cli keywords */
static struct cli_kw_list cli_kws = {{ },{
{ { "show", "pools", NULL }, "show pools : report information about the memory pools usage", NULL, cli_io_handler_dump_pools },