setjmp optimization#10
Open
puranikvinit wants to merge 3 commits into
Open
Conversation
Collaborator
|
@puranikvinit What if you temporarily point the SP to the buffer so that the |
Collaborator
does not sound like something one should do. This will fall apart in case of a trap, which would rely on a proper sp value. |
... and restore it when app exits. The commit 0bfd91d has a bug that the console mode is stored into the shared memory when both: (1) cygwin process is started from non-cygwin process. (2) cygwin process started from non-cygwin process exits. (1) is intended, but (2) is not. Due to (2), the stored console mode is unexpectedly broken when the cygwin process exits. Then the mode restored will be not as expected. This causes undesired console mode in the use case that cygwin and non-cygwin apps are mixed. With this patch, the console mode will stored only in the case (1). This is done by putting the code, which stores the console mode, into fhandler_console::open() rather than fhandler_console::set_input_mode() and fhandler_console::set_output_mode(). Fixes: 0bfd91d ("Cygwin: console: tty::restore really restores the previous mode") Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
In the commit 0bfd91d, the behaviour of the tty::restore was changed so that the console mode is set to the previouslly stored console mode. Therefore, the console mode for the background non- cygwin app should not be set to tty::restore anymore in setup_for_ non_cygwin_app(). This should have been fixed in that commit. This patch belatedly fixes it. Fixes: 0bfd91d ("Cygwin: console: tty::restore really restores the previous mode") Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
thebigclub
reviewed
May 10, 2025
RISC-V: setjmp: remove redundant checks for Zclsd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There wasn't much here to optimize, I just made use of the
Zilsdextension to reduce the code size. The entire code is basically register load/store instructions, no logic involved as such. Eric had suggested to have a look at theZcmpextension, but since we are using a buffer to save the register state and not the stack itself, I don't think it'd be useful.I got a code size reduction of
40bwhen the target supportsZilsdextension.