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

sdk: Avoid memory initialization on create program address #81

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

febo
Copy link
Collaborator

@febo febo commented Mar 1, 2025

Problem

As described on #79, create_program_address and try_find_program_address are currently initializing the memory for the derived pubkey. This is unnecessary since the memory is initialized by the syscall.

Solution

Avoid memory initialization by using a MaybeUninit array.

Fixes #79

@publicqi
Copy link
Contributor

publicqi commented Mar 1, 2025

try_find_program_address too

@febo febo force-pushed the febo/create-program-address branch from ef09c6c to 9c857ae Compare March 1, 2025 11:12
@febo febo marked this pull request as ready for review March 3, 2025 11:10
@febo febo merged commit e9c139a into main Mar 5, 2025
8 checks passed
@febo febo deleted the febo/create-program-address branch March 5, 2025 12:13
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.

unnecessary memory initialization
2 participants