Re-org memory allocation interfaces, add --stack-size and --heap-size option (#193)

This commit is contained in:
wenyongh
2020-03-10 19:54:44 +08:00
committed by GitHub
parent 381859d530
commit 0fdd49ea31
110 changed files with 1264 additions and 2125 deletions

View File

@ -158,14 +158,14 @@ bool am_register_resource(const char *url,
if (register_num >= RESOURCE_REGISTRATION_NUM_MAX)
return false;
r = (app_res_register_t *) bh_malloc(sizeof(app_res_register_t));
r = (app_res_register_t *) APP_MGR_MALLOC(sizeof(app_res_register_t));
if (r == NULL)
return false;
memset(r, 0, sizeof(*r));
r->url = bh_strdup(url);
if (r->url == NULL) {
bh_free(r);
APP_MGR_FREE(r);
return false;
}
@ -191,8 +191,8 @@ void am_cleanup_registeration(uint32 register_id)
else
g_resources = next;
bh_free(r->url);
bh_free(r);
APP_MGR_FREE(r->url);
APP_MGR_FREE(r);
} else
/* if r is freed, should not change prev. Only set prev to r
when r isn't freed. */