Skip to content

Commit e978606

Browse files
authored
Move some macros from WAMR to this project (#9)
Some macros are defined in WAMR repo but are unrelated to WAMR, we move them to this project instead. And fix typo of `RESOUCE_EVENT_URL_LEN_MAX`, change it to `RESOURCE_EVENT_URL_LEN_MAX`.
1 parent 8752a05 commit e978606

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

app-framework/connection/native/connection_lib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
extern "C" {
1414
#endif
1515

16+
#ifndef MAX_CONNECTION_PER_APP
17+
#define MAX_CONNECTION_PER_APP 3
18+
#endif
19+
1620
/**
1721
* This file defines connection library which should be implemented by
1822
* different platforms

app-mgr/app-manager/app_manager.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,36 @@
1515
extern "C" {
1616
#endif
1717

18+
/* Max app number of all modules */
19+
#ifndef MAX_APP_INSTALLATIONS
20+
#define MAX_APP_INSTALLATIONS 3
21+
#endif
22+
23+
/* Default timer number in one app */
24+
#ifndef DEFAULT_TIMERS_PER_APP
25+
#define DEFAULT_TIMERS_PER_APP 20
26+
#endif
27+
28+
/* Max timer number in one app */
29+
#ifndef MAX_TIMERS_PER_APP
30+
#define MAX_TIMERS_PER_APP 30
31+
#endif
32+
33+
/* Max resource registration number in one app */
34+
#ifndef RESOURCE_REGISTRATION_NUM_MAX
35+
#define RESOURCE_REGISTRATION_NUM_MAX 16
36+
#endif
37+
38+
/* Max length of resource/event url */
39+
#ifndef RESOURCE_EVENT_URL_LEN_MAX
40+
#define RESOURCE_EVENT_URL_LEN_MAX 256
41+
#endif
42+
43+
/* Default watchdog interval in ms */
44+
#ifndef DEFAULT_WATCHDOG_INTERVAL
45+
#define DEFAULT_WATCHDOG_INTERVAL (3 * 60 * 1000)
46+
#endif
47+
1848
#define APP_MGR_MALLOC wasm_runtime_malloc
1949
#define APP_MGR_FREE wasm_runtime_free
2050

app-mgr/app-manager/resource_reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ am_register_resource(const char *url,
158158
r = r->next;
159159
}
160160

161-
if (strlen(url) > RESOUCE_EVENT_URL_LEN_MAX)
161+
if (strlen(url) > RESOURCE_EVENT_URL_LEN_MAX)
162162
return false;
163163

164164
if (register_num >= RESOURCE_REGISTRATION_NUM_MAX)

0 commit comments

Comments
 (0)