We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
The jmp_buf defined in setjmp.h needs a large buffer, typedef __int64 jmp_buf[48]; //384 bytes
As we checked in function setjmp/longjmp used by Cortex M0/M3, it is used to save only few run-time data such as R0, R1, ...
On some platform which has very limited memory resource, the 384 bytes seems too expensive. What's the minimal size of jmp_buf?
Thanks!
Since you are considering modifying setjmp/longjmp shipped with the build tools, you might as well implement your own setjmp/longjmp. This way you'll be able to optimize them to the fullest. Yes, 384 bytes does seem excessive. I don't know what the minimum required size of jmp_buf is, but I think it's safe to assume that it only needs to be big enough to hold the data that setjmp saves.
I have to agree with you! Haha ...