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

ST: Replace macros with explicit code for better understanding. v7.0.7 #4149

Merged
merged 11 commits into from
Aug 22, 2024

Conversation

winlinvip
Copy link
Member

@winlinvip winlinvip commented Aug 20, 2024

Improvements for ST(State Threads):

  1. ST: Use g++ for CXX compiler.
  2. ST: Remove macros for clist.
  3. ST: Remove macros for global thread and vp.
  4. ST: Remove macros for vp queue operations.
  5. ST: Remove macros for context switch.
  6. ST: Remove macros for setjmp/longjmp.
  7. ST: Remove macro for stack pad.
  8. ST: Refine macro for valgrind.

Co-authored-by: Jacob Su suzp1984@gmail.com

@winlinvip winlinvip force-pushed the feature/st-cpp branch 4 times, most recently from 48a2ef6 to 93dfadb Compare August 21, 2024 03:36
@suzp1984
Copy link
Contributor

Is a inline function is much better?

And for the Macros keep them, use a compiling option to control the Macro definition.
The benefit is that most of the code will not changed. The Macro can be keep as deprecated or the functions can be an experimental.

#ifdef USE_MACRO
#define _ST_SWITCH_CONTEXT(_thread) ....
#else
#define _ST_SWITCH_CONTEXT(_thread)  _st_switch_context(_thread)
#endif 

@winlinvip winlinvip force-pushed the feature/st-cpp branch 2 times, most recently from a57bf01 to 61516ad Compare August 21, 2024 06:27
@winlinvip
Copy link
Member Author

Is a inline function is much better?

Winlin: Change to inline.

And for the Macros keep them, use a compiling option to control the Macro definition. The benefit is that most of the code will not changed. The Macro can be keep as deprecated or the functions can be an experimental.

Winlin: I don't believe that duplicated code is a good practice.

@winlinvip winlinvip changed the title ST: Replace macros with explicit code for better understanding ST: Replace macros with explicit code for better understanding. v7.0.7 Aug 21, 2024
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Aug 21, 2024
@winlinvip winlinvip merged commit ff6a608 into ossrs:develop Aug 22, 2024
17 checks passed
@winlinvip
Copy link
Member Author

See also 55610cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RefinedByAI Refined by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants