Skip to content

Conversation

cgswords
Copy link
Contributor

Description

This replaces Identifiers in the execution AST with IdentifierKey, because identifiers (and the strings they hold) led to memory leaks -- the string bytes were heap-allocated, so leaked when the Identifiers were dropped.

This also refactors the interner to be more self-contained.

Test plan

Tests all pass, plus this command reported no leaks:

RUSTFLAGS="-Zsanitizer=address" cargo +nightly test -j 1 -Zbuild-std --target x86_64-unknown-linux-gnu

This now reports no leaks.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@cgswords cgswords requested a review from tzakian February 19, 2025 00:22
Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 0:54am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 0:54am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 0:54am

@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env February 19, 2025 00:22 — with GitHub Actions Inactive
Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

LGTM

@cgswords cgswords force-pushed the cgswords/vm_ast_ident_keys branch from bdac164 to 5bddab4 Compare February 21, 2025 00:37
@cgswords cgswords requested review from anwayaa and pchrysochoidis and removed request for a team February 21, 2025 00:37
@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 00:37 — with GitHub Actions Inactive
@cgswords cgswords force-pushed the cgswords/vm_ast_ident_keys branch from 5bddab4 to b400c71 Compare February 21, 2025 00:53
@cgswords cgswords temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 00:53 — with GitHub Actions Inactive
@tzakian tzakian changed the base branch from tzakian/vm-rewrite-adapter-15 to bella-ciao February 21, 2025 21:51
Copy link
Contributor

@tzakian tzakian left a comment

Choose a reason for hiding this comment

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

Changes look good to me

/// modules. It exposes an intentionally spartan interface to prevent any unexpected behavior
/// (e.g., unstable iteration ordering) that Rust's standard collections run afoul of.
#[derive(Debug)]
pub struct DefinitionMap<Value>(HashMap<IntraPackageKey, Value>);
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

self.name.to_string().unwrap()
}

#[cfg(any(debug_assertions, feature = "tracing"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note (nothing for you to do): I'm going to be removing this cfg in another PR here soon -- runs afoul of building in release mode without tracing enabled since this function is used in the Debug implementation for bytecode.

@cgswords cgswords merged commit aa12029 into bella-ciao Feb 25, 2025
33 of 46 checks passed
@cgswords cgswords deleted the cgswords/vm_ast_ident_keys branch February 25, 2025 00:59
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.

2 participants