Log web browser page attributes free memory left.

After page loading has finished the number of free bytes left for page attributes is logged. It turns out that "usual" pages tend to get along with ~800 bytes while i.e. the Google search pages use all of the 2000 bytes of page attribute memory allocated by default (because of the long URLs with many parameters). So it seems that reducing this default isn't exactly the best way to reduce memory consumption...
This commit is contained in:
Oliver Schmidt 2015-11-01 21:22:19 +01:00
parent 1639b712bb
commit 0303944d0c

View file

@ -34,12 +34,14 @@
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include "ctk/ctk.h"
#include "ctk/ctk-textentry-cmdline.h"
#include "contiki-net.h"
#include "lib/petsciiconv.h"
#include "sys/arg.h"
#include "sys/log.h"
#if WWW_CONF_WITH_WGET
#include "program-handler.h"
#endif /* WWW_CONF_WITH_WGET */
@ -50,13 +52,6 @@
#include "www.h"
#if 1
#define PRINTF(x)
#else
#include <stdio.h>
#define PRINTF(x) printf x
#endif
/* The array that holds the current URL. */
static char url[WWW_CONF_MAX_URLLEN + 1];
@ -299,6 +294,8 @@ end_page(char *status, void *focus)
petsciiconv_topetscii(webpageptr - x, x);
CTK_WIDGET_FOCUS(&mainwindow, focus);
redraw_window();
log_message("Page attribs free: ", itoa(pageattribs + sizeof(pageattribs) - pageattribptr,
pageattribs + sizeof(pageattribs) - 4, 10));
}
/*-----------------------------------------------------------------------------------*/
/* open_url():