-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Should the C++ constructor and destructor tables move into FLASH? #8731
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
Comments
We could just copy-paste those .{c,d}tor entries from the vtables .h .rodata into the .irom0 one? No relation to vtables, just move those to flash at all times |
IIRC they're in RAM now because of IRQ safety. If any classes are used in IRQ handlers, you can't be sure the flash is accessible so risk crashes. There was a bug I can't find opened about this after the original memory map shuffling... |
Arent dtors & ctors (and the whole init array) are supposed to be used for global objects? IRQ code will inject ctor / dtor call when needed, where the actual section can be changed with the IRAM attr |
Good catch, that sounds right. The Arduino/cores/esp8266/core_esp8266_main.cpp Lines 271 to 278 in fe451a8
BSS start/end, I think is used by the ROM code to do the I'd say move it at this point. We're not saving all that much space at this point, but every byte counts... |
Arduino/tools/sdk/ld/eagle.app.v6.common.ld.vtables.h
Lines 15 to 26 in fe451a8
and
Arduino/tools/sdk/ld/eagle.app.v6.common.ld.vtables.h
Lines 35 to 39 in fe451a8
These are all 32bit pointers.
It should move into flash to reduce memory usage.
I change it in my repo.
metarutaiga@3bc7ce4
The text was updated successfully, but these errors were encountered: