summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/doom/rockdoom.c3
-rw-r--r--apps/plugins/lua/malloc.c17
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, ...)
{
static int p_xtpt;
char p_buf[50];
- bool ok;
rb->yield();
va_list ap;
va_start(ap, fmt);
- ok = vsnprintf(p_buf,sizeof(p_buf), fmt, ap);
+ vsnprintf(p_buf,sizeof(p_buf), fmt, ap);
va_end(ap);
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) {
static void internal_malloc_stats(mstate m) {
if (!PREACTION(m)) {
- size_t maxfp = 0;
- size_t fp = 0;
- size_t used = 0;
check_malloc_state(m);
if (is_initialized(m)) {
msegmentptr s = &m->seg;
- maxfp = m->max_footprint;
- fp = m->footprint;
- used = fp - (m->topsize + TOP_FOOT_SIZE);
-
+ size_t used = m->footprint - (m->topsize + TOP_FOOT_SIZE);
while (s != 0) {
mchunkptr q = align_as_chunk(s->base);
while (segment_holds(s, q) &&
@@ -2843,12 +2837,13 @@ static void internal_malloc_stats(mstate m) {
}
s = s->next;
}
+ DEBUGF("max system bytes = %10zu\n", m->max_footprint);
+ DEBUGF("system bytes = %10zu\n", m->footprint);
+ DEBUGF("in use bytes = %10zu\n", used);
+ } else {
+ DEBUGF("malloc not initialized\n");
}
- DEBUGF("max system bytes = %10lu\n", (unsigned long)(maxfp));
- DEBUGF("system bytes = %10lu\n", (unsigned long)(fp));
- DEBUGF("in use bytes = %10lu\n", (unsigned long)(used));
-
POSTACTION(m);
}
}