Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Destroy vectors with elements #368

Merged
merged 1 commit into from Sep 18, 2023
Merged

Destroy vectors with elements #368

merged 1 commit into from Sep 18, 2023

Conversation

brson
Copy link
Collaborator

@brson brson commented Sep 15, 2023

This implements the vec_destroy runtime call for vectors with elements, including other vectors and structs.

This patch makes the encode_128 test pass, as described in #333, but it causes encode_129 to fail (because move-native serializes a deeply nested type that should instead produce a recursion-limit error). I filed #367 about encode_129.

Fixes #333

Copy link
Collaborator

@dmakarov dmakarov left a comment

Choose a reason for hiding this comment

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

Thank you!

///
/// Unsafe because the provided type must be correct.
//
// todo: We should probably just leak the vector instead of
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add a flag that will help switch between leak vs. drop. that'd be easier to test i guess. maybe as a separate patch if you think this is a good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah we can do that separately.

@ksolana
Copy link
Collaborator

ksolana commented Sep 18, 2023

!help

@github-actions
Copy link

USAGE:
    ![COMMANDS]

COMMANDS:
    add-pr-link

@ksolana ksolana mentioned this pull request Sep 18, 2023
@brson brson merged commit 172dbd8 into anza-xyz:llvm-sys Sep 18, 2023
8 of 9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] stdlib bcs tests encode_128 and encode_129 break on non-empty vector destroying
3 participants