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

Extension modules with unneeded module state #94401

Closed
1 of 2 tasks
erlend-aasland opened this issue Jun 29, 2022 · 0 comments · Fixed by #94403 or #94402
Closed
1 of 2 tasks

Extension modules with unneeded module state #94401

erlend-aasland opened this issue Jun 29, 2022 · 0 comments · Fixed by #94403 or #94402
Labels
3.12 bugs and security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Jun 29, 2022

Similar to #94395 and #94393.

The bz2 and overlapped extension modules both have unneeded module state. That is, their state only contains pointers to types that are only added to the module's dict, and not used anywhere else. This implies:

  • there is no need to allocate and deallocate module state
  • there is no need to implement the traverse/clear/free module methods
  • there is no need for a state struct, and related "get state" helpers

For each module, this amounts to approx. 50 fewer lines of code. Less code, less maintenance.

For extension modules with partial unneeded module state, it may be best to leave them as they are; consistency also has a value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes extension-modules C modules in the Modules dir type-feature A feature request or enhancement
Projects
None yet
1 participant