Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function cont_get_free_stack is not available anymore #5118

Closed
lmarmisa opened this issue Sep 10, 2018 · 4 comments
Closed

Function cont_get_free_stack is not available anymore #5118

lmarmisa opened this issue Sep 10, 2018 · 4 comments

Comments

@lmarmisa
Copy link

The new release 2.4.2 includes this change:

. Move continuation stack from .bss onto sys stack, saving 4kB of RAM, if WPS is not needed (#4622)

But there is a side effect: the function cont_get_free_stack(&g_cont) [cont.h] does not work because the variable g_cont is not defined anymore (file core_esp8266_main.cpp).

My programs include stack statistics but I am unable to maintain this feature if I use the new release 2.4.2.

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 10, 2018

Is it working with g_pcont instead of &g_cont ?

@lmarmisa
Copy link
Author

lmarmisa commented Sep 11, 2018

Yes, g_pcont did the trick. Thanks for your help.

I did not use the variable g_pcont before because this comment [core_esp8266_main.cpp] confused me:

/* Not static, used in core_esp8266_postmortem.c.
 * Placed into noinit section because we assign value to this variable
 * before .bss is zero-filled, and need to preserve the value.
 */
cont_t* g_pcont __attribute__((section(".noinit")));

(edit: ` -> ```)

@devyte
Copy link
Collaborator

devyte commented Sep 13, 2018

This is stupid. We need an interface for free stack in ESPClass as a wrapper to this.

@devyte
Copy link
Collaborator

devyte commented Sep 13, 2018

@lmarmisa please test #5133 . Instead of using cont_get_free_stack(g_pcont), just use ESP.getFreeContStack().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants