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

Move ReferenceCounter to an interface #3524

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Move ReferenceCounter to an interface #3524

wants to merge 6 commits into from

Conversation

shargon
Copy link
Member

@shargon shargon commented Oct 10, 2024

Description

First step of #3517

  • Move ReferenceCounter to an interface

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Test A
  • Test B

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shargon
Copy link
Member Author

shargon commented Oct 10, 2024

What do you think @neo-project/core ? if we push an item, we call Add, if we pop a item, we call remove, same for Compound items, and when a pop is done in a compound item, we call Remove also.

In this way, we have a better system, the worst, two same stack items, will be counted as two, but we will be faster, and we can increase the limmit

sample b50ab91

@shargon shargon changed the title Remove Tarjan Move Reference counter to an interface Oct 10, 2024
@shargon shargon marked this pull request as ready for review October 10, 2024 15:05
@shargon shargon changed the title Move Reference counter to an interface Move ReferenceCounter to an interface Oct 10, 2024
@shargon shargon requested a review from Jim8y October 10, 2024 16:27
@Jim8y
Copy link
Contributor

Jim8y commented Oct 10, 2024

What do you think @neo-project/core ? if we push an item, we call Add, if we pop a item, we call remove, same for Compound items, and when a pop is done in a compound item, we call Remove also.

In this way, we have a better system, the worst, two same stack items, will be counted as two, but we will be faster, and we can increase the limmit

sample b50ab91

but pop and push are very classical name for operations on stack~~~~

BTW, how about name the referencecounter as something like referencecounter with GC, or GC referencecounter,,,,

@vncoelho
Copy link
Member

What do you think @neo-project/core ? if we push an item, we call Add, if we pop a item, we call remove, same for Compound items, and when a pop is done in a compound item, we call Remove also.

In this way, we have a better system, the worst, two same stack items, will be counted as two, but we will be faster, and we can increase the limmit

sample b50ab91

Sure, @shargon

Let me discuss this internally here and soon reply with more ideas. Next Monday at least before merging this one.

@igormcoelho
Copy link
Contributor

It's very nice to have a clear interface on ReferenceCounter. Congratulations @shargon .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants