Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 85e95dbeb -> 13cc78035
bleprph - Move stack from bss to heap. When an app is used as a loader, its bss contents are reserved and off-limits to the application slot. It is wasteful to put the loader-objects big objects in bss, since they never get used anyway once the loader jumps to the application-app. The fix is to malloc the stack in the loader. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/fe584eb0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/fe584eb0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/fe584eb0 Branch: refs/heads/develop Commit: fe584eb00e1f87cfdd0695c82545c5f9cdf6e044 Parents: 85e95db Author: Christopher Collins <[email protected]> Authored: Thu Jan 19 15:00:45 2017 -0800 Committer: Christopher Collins <[email protected]> Committed: Thu Jan 19 15:00:45 2017 -0800 ---------------------------------------------------------------------- apps/bleprph/src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/fe584eb0/apps/bleprph/src/main.c ---------------------------------------------------------------------- diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c index df5b847..65911a5 100755 --- a/apps/bleprph/src/main.c +++ b/apps/bleprph/src/main.c @@ -48,7 +48,7 @@ struct log bleprph_log; struct os_eventq bleprph_evq; struct os_task bleprph_task; -bssnz_t os_stack_t bleprph_stack[BLEPRPH_STACK_SIZE]; +bssnz_t os_stack_t *bleprph_stack; static int bleprph_gap_event(struct ble_gap_event *event, void *arg); @@ -285,6 +285,9 @@ main(void) /* Initialize eventq */ os_eventq_init(&bleprph_evq); + bleprph_stack = malloc(sizeof bleprph_stack * BLEPRPH_STACK_SIZE); + assert(bleprph_stack != NULL); + /* Create the bleprph task. All application logic and NimBLE host * operations are performed in this task. */
