diff options
-rw-r--r-- | apps/plugins/doom/rockdoom.c | 3 | ||||
-rw-r--r-- | apps/plugins/lua/malloc.c | 17 |
2 files changed, 7 insertions, 13 deletions
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 6ce0e6d38d..1c2777a8ad 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c | |||
@@ -114,12 +114,11 @@ int printf(const char *fmt, ...) | |||
114 | { | 114 | { |
115 | static int p_xtpt; | 115 | static int p_xtpt; |
116 | char p_buf[50]; | 116 | char p_buf[50]; |
117 | bool ok; | ||
118 | rb->yield(); | 117 | rb->yield(); |
119 | va_list ap; | 118 | va_list ap; |
120 | 119 | ||
121 | va_start(ap, fmt); | 120 | va_start(ap, fmt); |
122 | ok = vsnprintf(p_buf,sizeof(p_buf), fmt, ap); | 121 | vsnprintf(p_buf,sizeof(p_buf), fmt, ap); |
123 | va_end(ap); | 122 | va_end(ap); |
124 | 123 | ||
125 | rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); | 124 | rb->lcd_putsxy(1,p_xtpt, (unsigned char *)p_buf); |
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 | } |