Skip to content

Rework Neighbor Cache to use Weak References#2828

Merged
Zorbatron merged 3 commits into
masterfrom
gh/weak-ref-neighbors
Aug 7, 2025
Merged

Rework Neighbor Cache to use Weak References#2828
Zorbatron merged 3 commits into
masterfrom
gh/weak-ref-neighbors

Conversation

@ghzdude

@ghzdude ghzdude commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

What

Refactors the neighbor cache to use a list of weak references instead of an array with direct references

Implementation Details

add NULL and INVALID weak references to mimic previous logic.
if INVALID, the neighbor should be recomputed, otherwise either the TE or null should be returned
It also needs to be checked that the neighbors are not null unexpectedly due to referent being lost somehow

Outcome

Theoretically, references to neighboring TEs should be GC'd properly now.

@ghzdude ghzdude requested a review from a team as a code owner June 18, 2025 08:21
@ghzdude ghzdude added the type: refactor Suggestion to refactor a section of code label Jun 18, 2025
move comment to more appropriate place
mark certain methods as not null
@Zorbatron Zorbatron merged commit 41f3711 into master Aug 7, 2025
3 checks passed
@Zorbatron Zorbatron deleted the gh/weak-ref-neighbors branch August 7, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: refactor Suggestion to refactor a section of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants