芯方式

Web widget Memory Configuration

0
阅读(2001)

[DESCRIPTION]
This item describes how to configure the memory pool used by widget engine. The memory pool can be a
static heap memory or use application share
memory (ASM) for limited RAM space. You should first decide whether Widget pool will be using ASM or
not, and then configure the size of memory pool
used by widget engine. If ASM is used, you should also decide whether the coexistence with Browser is
guaranteed. The details will be introduced in the
following sections.
[SOLUTION]
1.1 Custom files
There are two custom files.
1). “custom_gadget_cfg.h” located in custom\app\[*PROJECT_NAME]\
2). “custom_gadget_config.h” located in custom\common
Notice that the precedence of “custom_gadget_cfg.h” is higher than “custom_gadget_config.h”.
Ps. * PROJECT_NAME depends on each project’s naming.
1.2 Options
1.2.1 GADGET_USE_ASM
If Widget uses ASM, this option must be defined. If not, all the memory used by Widget is from a static
memory pool.
Example,
#define GADGET_USE_ASM
1.2.2 GADGET_CUSTOM_CFG_SYS_MEM_SIZE
Whether Widget uses ASM or not, it must have a static memory pool for basic operation, for example,
installation, entering widget manager and so on. If Widget
uses ASM, 200KB static memory shall be enough. If not, it requires a larger size since all used memory
is from the static pool.
Example,
#define GADGET_CUSTOM_CFG_SYS_MEM_SIZE (180 * 1024)
1.2.3 GADGET_CUSTOM_CFG_ASM_MEM_SIZE (valid if ASM is used)
If GADGET_USE_ASM is defined, this option will have effect. It is used to configure the size of ASM that
Widget needs.
Example,
#define GADGET_CUSTOM_CFG_ASM_MEM_SIZE (2000 * 1024)
1.2.4 GADGE_BROWSER_CONCURRENCE (valid if ASM is used)
This option is used to guarantee the coexistence of Widget and Browser. If defined, it will make sure
the ASM pool size is large enough for Widget and Browser
concurrently. This can avoid the situation that widget is asked to be closed when user wants to launch
the Browser. If GADGE_BROWSER_CONCURRENCE is not
defined, the coexistence of widget and browser will be not guaranteed. It depends on how large the ASM
is configured.
Example,
#define GADGE_BROWSER_CONCURRENCE
1.3 Make modules
When the configuration is changed, you have to clean and remake custom and applib. This makes the change
take effect.
Example,
make c,r custom applib
1.4 Configuration examples
The following shows some examples of configuration.
1.4.1 Widget does not use ASM
#define GADGET_CUSTOM_CFG_SYS_MEM_SIZE (2500 * 1024)
1.4.2 Widget uses ASM
1.4.2.1 Coexistence with Browser is guaranteed
#define GADGET_USE_ASM
#define GADGET_CUSTOM_CFG_SYS_MEM_SIZE (180 * 1024)
#define GADGET_CUSTOM_CFG_ASM_MEM_SIZE (3000 * 1024)
#define GADGE_BROWSER_CONCURRENCE
1.4.2.2 Coexistence with Browser is not guaranteed
#define GADGET_USE_ASM
#define GADGET_CUSTOM_CFG_SYS_MEM_SIZE (180 * 1024)
#define GADGET_CUSTOM_CFG_ASM_MEM_SIZE (3000 * 1024)


来自半导体社区