-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Feature or enhancement
Lines 974 to 985 in 7a2d77c
| dump_frame(fd, frame); | |
| frame = frame->previous; | |
| if (frame == NULL) { | |
| break; | |
| } | |
| if (frame->owner == FRAME_OWNED_BY_CSTACK) { | |
| /* Trampoline frame */ | |
| frame = frame->previous; | |
| } | |
| if (frame == NULL) { | |
| break; | |
| } |
In the above code, it seems that it's redundant.
Line 983 in 7a2d77c
| if (frame == NULL) { |
Removing this extra if statement may eliminate the time consumed by the conditional statement.
In
Lines 975 to 976 in 7a2d77c
| frame = frame->previous; | |
| if (frame == NULL) { |
if frame is empty, it may not be executed
Lines 979 to 982 in 7a2d77c
| if (frame->owner == FRAME_OWNED_BY_CSTACK) { | |
| /* Trampoline frame */ | |
| frame = frame->previous; | |
| } |
So it will not be executed
Lines 983 to 986 in 7a2d77c
| if (frame == NULL) { | |
| break; | |
| } | |
| /* Can't have more than one shim frame in a row */ |
Logically speaking, if the frame is not NULL, then frame->previous can't be NULL either. This means frame->previous->previous won't be NULL either. If the frame has a forward link, frame->next, then it will have a unique successor.
If there are errors in my proposal or I don't understand the code base, please point out my mistakes, thanks.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response