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

[Neo VM Style] Add comments and document to reference counter #3331

Merged
merged 7 commits into from
Jun 26, 2024

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jun 12, 2024

Description

Neo VM reference counter is a very important component, but it is very complex and is hard to understand. Making it actually UNMAINTAINABLE. Thus having this pr that adds detailed explaination and comments to all its related code.

Fixes # None

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 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

src/Neo.VM/Types/Array.cs Outdated Show resolved Hide resolved
src/Neo.VM/ReferenceCounter.md Outdated Show resolved Hide resolved
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

I think that we should wait for #3328 before merge it, because of conflicts

@Jim8y
Copy link
Contributor Author

Jim8y commented Jun 12, 2024

I think that we should wait for #3328 before merge it, because of conflicts

should be fine, its just comments.

if (!item.ObjectReferences.TryGetValue(parent, out var pEntry))
{
pEntry = new(parent);
pEntry = new StackItem.ObjectReferenceEntry(parent);
Copy link
Member

Choose a reason for hiding this comment

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

Can you revert this change from here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Problems like this are very minor, not worth a pr to fix, but if we don't fix it, it will always be this unclear syntax.

Copy link
Member

Choose a reason for hiding this comment

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

Fix in another PR, it is better.
Let just comments here

Even the underscore could be moved to another PR.

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

Looks good, @Jim8y

There is just a minor change to be reverted I think

@NGDAdmin NGDAdmin merged commit aaf5ef6 into neo-project:master Jun 26, 2024
6 checks passed
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.

5 participants