diff options
Diffstat (limited to 'apps/plugins/lua')
-rw-r--r-- | apps/plugins/lua/malloc.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/plugins/lua/malloc.c b/apps/plugins/lua/malloc.c index e96497e4bb..6af2998549 100644 --- a/apps/plugins/lua/malloc.c +++ b/apps/plugins/lua/malloc.c | |||
@@ -2823,16 +2823,10 @@ static struct mallinfo internal_mallinfo(mstate m) { | |||
2823 | 2823 | ||
2824 | static void internal_malloc_stats(mstate m) { | 2824 | static void internal_malloc_stats(mstate m) { |
2825 | if (!PREACTION(m)) { | 2825 | if (!PREACTION(m)) { |
2826 | size_t maxfp = 0; | ||
2827 | size_t fp = 0; | ||
2828 | size_t used = 0; | ||
2829 | check_malloc_state(m); | 2826 | check_malloc_state(m); |
2830 | if (is_initialized(m)) { | 2827 | if (is_initialized(m)) { |
2831 | msegmentptr s = &m->seg; | 2828 | msegmentptr s = &m->seg; |
2832 | maxfp = m->max_footprint; | 2829 | size_t used = m->footprint - (m->topsize + TOP_FOOT_SIZE); |
2833 | fp = m->footprint; | ||
2834 | used = fp - (m->topsize + TOP_FOOT_SIZE); | ||
2835 | |||
2836 | while (s != 0) { | 2830 | while (s != 0) { |
2837 | mchunkptr q = align_as_chunk(s->base); | 2831 | mchunkptr q = align_as_chunk(s->base); |
2838 | while (segment_holds(s, q) && | 2832 | while (segment_holds(s, q) && |
@@ -2843,12 +2837,13 @@ static void internal_malloc_stats(mstate m) { | |||
2843 | } | 2837 | } |
2844 | s = s->next; | 2838 | s = s->next; |
2845 | } | 2839 | } |
2840 | DEBUGF("max system bytes = %10zu\n", m->max_footprint); | ||
2841 | DEBUGF("system bytes = %10zu\n", m->footprint); | ||
2842 | DEBUGF("in use bytes = %10zu\n", used); | ||
2843 | } else { | ||
2844 | DEBUGF("malloc not initialized\n"); | ||
2846 | } | 2845 | } |
2847 | 2846 | ||
2848 | DEBUGF("max system bytes = %10lu\n", (unsigned long)(maxfp)); | ||
2849 | DEBUGF("system bytes = %10lu\n", (unsigned long)(fp)); | ||
2850 | DEBUGF("in use bytes = %10lu\n", (unsigned long)(used)); | ||
2851 | |||
2852 | POSTACTION(m); | 2847 | POSTACTION(m); |
2853 | } | 2848 | } |
2854 | } | 2849 | } |