Skip to content

Conversation

@extinguish
Copy link

Summary

  1. Merged cu.h into cu_main.c to simplify the code structure and reduce file dependencies.
  2. Implemented CU exit logic following the pattern used in the top command, using a local cu_globals_s instance to manage the CU exit process.

Impact

  1. Reduces separation between header and source files, improving code maintainability and readability.
  2. Introduces a more controlled CU exit mechanism, enhancing program stability and predictability during shutdown, and preventing potential resource leaks.

Testing

Verified that CU compiles and runs correctly in a local environment, with the exit process behaving as expected.

using the local cu_globals_s instance to manange the cu exit procedure

Signed-off-by: guoshichao <[email protected]>
the macro and data type that defined in cu.h is only used in cu.c, so we
could merge the definitions items inside cu.h to cu.c directly, which
make the code structure more cleaner

Signed-off-by: guoshichao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants