summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-11-05 19:12:23 +0000
committerThomas Martitz <kugel@rockbox.org>2010-11-05 19:12:23 +0000
commit5411e14c57185b2b33fbfbb7ff7fec8ca2700551 (patch)
tree41149a1100c3ba708e0065cd7409c2e14ac976b2 /apps
parentd98f2929e9c07505056d846d1d309f1e16694ce7 (diff)
downloadrockbox-5411e14c57185b2b33fbfbb7ff7fec8ca2700551.tar.gz
rockbox-5411e14c57185b2b33fbfbb7ff7fec8ca2700551.zip
Undo the part of r28480 that caused the simulator to also use host malloc.
We want simulators to simulate target code where possible, that includes memory constraints and memory allocation schemes. It also removed the sim's ability to show the theme's ram usage. Use malloc only in application builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28498 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_engine.c12
-rw-r--r--apps/gui/skin_engine/skin_parser.c6
-rw-r--r--apps/menus/main_menu.c8
3 files changed, 13 insertions, 13 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 960bbdb313..25baeb2c3c 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -40,18 +40,18 @@
40 40
41static bool skins_initialising = true; 41static bool skins_initialising = true;
42 42
43/* Hosted platforms use the host malloc to manage the buffer */ 43/* App uses the host malloc to manage the buffer */
44#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 44#ifdef APPLICATION
45static char *skin_buffer = NULL; 45#define skin_buffer NULL
46void theme_init_buffer(void) 46void theme_init_buffer(void)
47{ 47{
48 skin_buffer = buffer_alloc(SKIN_BUFFER_SIZE);
49 skins_initialising = false; 48 skins_initialising = false;
50} 49}
51#else 50#else
52#define skin_buffer NULL 51static char *skin_buffer = NULL;
53void theme_init_buffer(void) 52void theme_init_buffer(void)
54{ 53{
54 skin_buffer = buffer_alloc(SKIN_BUFFER_SIZE);
55 skins_initialising = false; 55 skins_initialising = false;
56} 56}
57#endif 57#endif
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index c0ea3e3ca9..ad3e7e48ce 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1613,13 +1613,13 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
1613 wps_data->backdrop_id = -1; 1613 wps_data->backdrop_id = -1;
1614#endif 1614#endif
1615 /* parse the skin source */ 1615 /* parse the skin source */
1616#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 1616#ifndef APPLICATION
1617 skin_buffer_save_position(); 1617 skin_buffer_save_position();
1618#endif 1618#endif
1619 wps_data->tree = skin_parse(wps_buffer, skin_element_callback, wps_data); 1619 wps_data->tree = skin_parse(wps_buffer, skin_element_callback, wps_data);
1620 if (!wps_data->tree) { 1620 if (!wps_data->tree) {
1621 skin_data_reset(wps_data); 1621 skin_data_reset(wps_data);
1622#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 1622#ifndef APPLICATION
1623 skin_buffer_restore_position(); 1623 skin_buffer_restore_position();
1624#endif 1624#endif
1625 return false; 1625 return false;
@@ -1643,7 +1643,7 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
1643 !skin_load_fonts(wps_data)) 1643 !skin_load_fonts(wps_data))
1644 { 1644 {
1645 skin_data_reset(wps_data); 1645 skin_data_reset(wps_data);
1646#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 1646#ifndef APPLICATION
1647 skin_buffer_restore_position(); 1647 skin_buffer_restore_position();
1648#endif 1648#endif
1649 return false; 1649 return false;
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 98f664eda6..54fdb55b09 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -147,7 +147,7 @@ enum infoscreenorder
147 INFO_DISK1, /* capacity or internal capacity/free on hotswap */ 147 INFO_DISK1, /* capacity or internal capacity/free on hotswap */
148 INFO_DISK2, /* free space or external capacity/free on hotswap */ 148 INFO_DISK2, /* free space or external capacity/free on hotswap */
149 INFO_BUFFER, 149 INFO_BUFFER,
150#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 150#ifndef APPLICATION
151 INFO_SKIN_USAGE, /* ram usage of the skins */ 151 INFO_SKIN_USAGE, /* ram usage of the skins */
152#endif 152#endif
153 INFO_VERSION, 153 INFO_VERSION,
@@ -159,7 +159,7 @@ static const char* info_getname(int selected_item, void *data,
159{ 159{
160 struct info_data *info = (struct info_data*)data; 160 struct info_data *info = (struct info_data*)data;
161 char s1[32]; 161 char s1[32];
162#if defined(HAVE_MULTIVOLUME) || ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 162#if defined(HAVE_MULTIVOLUME) || !defined(APPLICATION)
163 char s2[32]; 163 char s2[32];
164#endif 164#endif
165 if (info->new_data) 165 if (info->new_data)
@@ -246,7 +246,7 @@ static const char* info_getname(int selected_item, void *data,
246 snprintf(buffer, buffer_len, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); 246 snprintf(buffer, buffer_len, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
247#endif 247#endif
248 break; 248 break;
249#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 249#ifndef APPLICATION
250 case INFO_SKIN_USAGE: 250 case INFO_SKIN_USAGE:
251 output_dyn_value(s1, sizeof s1, skin_buffer_usage(), byte_units, true); 251 output_dyn_value(s1, sizeof s1, skin_buffer_usage(), byte_units, true);
252 output_dyn_value(s2, sizeof s2, skin_buffer_usage() 252 output_dyn_value(s2, sizeof s2, skin_buffer_usage()
@@ -334,7 +334,7 @@ static int info_speak_item(int selected_item, void * data)
334 output_dyn_value(NULL, 0, info->size, kbyte_units, true); 334 output_dyn_value(NULL, 0, info->size, kbyte_units, true);
335#endif 335#endif
336 break; 336 break;
337#if ((CONFIG_PLATFORM&PLATFORM_HOSTED) == 0) 337#ifndef APPLICATION
338 case INFO_SKIN_USAGE: 338 case INFO_SKIN_USAGE:
339 talk_id(LANG_SKIN_RAM_USAGE, false); 339 talk_id(LANG_SKIN_RAM_USAGE, false);
340 output_dyn_value(NULL, 0, skin_buffer_usage(), byte_units, true); 340 output_dyn_value(NULL, 0, skin_buffer_usage(), byte_units, true);