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

Speedups: no cinit, no pickling #2851

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

black-sliver
Copy link
Member

@black-sliver black-sliver commented Feb 21, 2024

What is this fixing or adding?

  • remove unnecessary cinit
    This was meant for (memory) safety, but cython docs clearly state that this
    is done automatically. The code generated for cinit with args is what
    triggers a 'possible null deref' in clang's static analyzer, so by removing
    cinit, we can now use static analysis.
  • disable pickling of LocationStore and internal classes
    This reduces code size and avoids accidentally pickling them.

(Declaring __cinit__ did disable __reduce__ for LocationStore (but not for internal classes), so adding this in the same PR.)

How was this tested?

Unit tests and scan-build -disable-checker deadcode.DeadStores --status-bugs python setup.py build

This was meant for (memory) safety, but cython docs clearly state that this
is done automatically. The code generated for cinit with args is what
triggers a 'possible null deref' in clang's static analyzer, so by removing
cinit, we can now use static analysis.
... of LocationStore and internal classes.
This reduces code size and avoids accidentally pickling them.
@github-actions github-actions bot added waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. affects: core Issues/PRs that touch core and may need additional validation. labels Feb 21, 2024
Copy link
Member

@Berserker66 Berserker66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read it, didn't test it

@black-sliver black-sliver merged commit 17c7391 into ArchipelagoMW:main Feb 21, 2024
10 checks passed
@github-actions github-actions bot removed the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Feb 21, 2024
@black-sliver black-sliver deleted the speedups-no-cinit branch February 21, 2024 07:54
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
* Speedups: remove unnecessary cinit

This was meant for (memory) safety, but cython docs clearly state that this
is done automatically. The code generated for cinit with args is what
triggers a 'possible null deref' in clang's static analyzer, so by removing
cinit, we can now use static analysis.

* Speedups: disable pickling ...

... of LocationStore and internal classes.
This reduces code size and avoids accidentally pickling them.
TheLX5 pushed a commit to TheLX5/Archipelago that referenced this pull request Mar 2, 2024
* Speedups: remove unnecessary cinit

This was meant for (memory) safety, but cython docs clearly state that this
is done automatically. The code generated for cinit with args is what
triggers a 'possible null deref' in clang's static analyzer, so by removing
cinit, we can now use static analysis.

* Speedups: disable pickling ...

... of LocationStore and internal classes.
This reduces code size and avoids accidentally pickling them.
TheLX5 pushed a commit to TheLX5/Archipelago that referenced this pull request Mar 2, 2024
* Speedups: remove unnecessary cinit

This was meant for (memory) safety, but cython docs clearly state that this
is done automatically. The code generated for cinit with args is what
triggers a 'possible null deref' in clang's static analyzer, so by removing
cinit, we can now use static analysis.

* Speedups: disable pickling ...

... of LocationStore and internal classes.
This reduces code size and avoids accidentally pickling them.
EmilyV99 pushed a commit to EmilyV99/Archipelago that referenced this pull request Apr 15, 2024
* Speedups: remove unnecessary cinit

This was meant for (memory) safety, but cython docs clearly state that this
is done automatically. The code generated for cinit with args is what
triggers a 'possible null deref' in clang's static analyzer, so by removing
cinit, we can now use static analysis.

* Speedups: disable pickling ...

... of LocationStore and internal classes.
This reduces code size and avoids accidentally pickling them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants