aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/free.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/procps/free.c b/procps/free.c
index 0adef501f..142786083 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -52,6 +52,7 @@ static unsigned long long scale(struct globals *g, unsigned long d)
52 return ((unsigned long long)d * g->mem_unit) >> G_unit_steps; 52 return ((unsigned long long)d * g->mem_unit) >> G_unit_steps;
53} 53}
54 54
55#if !ENABLE_PLATFORM_MINGW32
55/* NOINLINE reduces main() stack usage, which makes code smaller (on x86 at least) */ 56/* NOINLINE reduces main() stack usage, which makes code smaller (on x86 at least) */
56static NOINLINE unsigned int parse_meminfo(struct globals *g) 57static NOINLINE unsigned int parse_meminfo(struct globals *g)
57{ 58{
@@ -78,6 +79,14 @@ static NOINLINE unsigned int parse_meminfo(struct globals *g)
78 79
79 return seen_cached_and_available_and_reclaimable == 0; 80 return seen_cached_and_available_and_reclaimable == 0;
80} 81}
82#else
83static NOINLINE unsigned int parse_meminfo(struct globals *g)
84{
85 g->cached_kb = g->available_kb = g->reclaimable_kb = 0;
86
87 return 1;
88}
89#endif
81 90
82int free_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 91int free_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
83int free_main(int argc UNUSED_PARAM, char **argv IF_NOT_DESKTOP(UNUSED_PARAM)) 92int free_main(int argc UNUSED_PARAM, char **argv IF_NOT_DESKTOP(UNUSED_PARAM))
@@ -135,9 +144,15 @@ int free_main(int argc UNUSED_PARAM, char **argv IF_NOT_DESKTOP(UNUSED_PARAM))
135 } 144 }
136#endif 145#endif
137 146
147#if !ENABLE_PLATFORM_MINGW32
138#define FIELDS_6 "%12llu %11llu %11llu %11llu %11llu %11llu\n" 148#define FIELDS_6 "%12llu %11llu %11llu %11llu %11llu %11llu\n"
139#define FIELDS_3 (FIELDS_6 + 6 + 7 + 7) 149#define FIELDS_3 (FIELDS_6 + 6 + 7 + 7)
140#define FIELDS_2 (FIELDS_6 + 6 + 7 + 7 + 7) 150#define FIELDS_2 (FIELDS_6 + 6 + 7 + 7 + 7)
151#else
152#define FIELDS_6 "%12I64u %11I64u %11I64u %11I64u %11I64u %11I64u\n"
153#define FIELDS_3 (FIELDS_6 + 7 + 8 + 8)
154#define FIELDS_2 (FIELDS_6 + 8 + 8 + 8 + 8)
155#endif
141 156
142 printf(FIELDS_6, 157 printf(FIELDS_6,
143 scale(&G, info.totalram), //total 158 scale(&G, info.totalram), //total