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

Refactor Process struct #1100

Closed
frisitano opened this issue Oct 10, 2023 · 1 comment
Closed

Refactor Process struct #1100

frisitano opened this issue Oct 10, 2023 · 1 comment
Labels
processor Related to Miden VM processor
Milestone

Comments

@frisitano
Copy link
Contributor

As part of #1082, the introduction of the Host object and associated ProcessState, we had to place the Host object behind a RefCell to leverage the interior mutability pattern and defer borrow checks to runtime. This is because we take a mutable and immutable reference of the Process object when invoking Host requests. However, we never modify any of the fields of the Process struct which are read as immutable. To remove the requirement for the usage of the RefCell we should refactor the Process struct as follows:

struct Process<H>
where
    H: Host,
{
    state: VmState,
    host: H,
    max_cycles: u32,
}

See this comment thread for more insight: #1082 (comment)

@bobbinth bobbinth added the processor Related to Miden VM processor label Oct 10, 2023
@bobbinth bobbinth added this to the v0.9 milestone Jan 11, 2024
@bobbinth bobbinth modified the milestones: v0.9, v0.11.0 Jul 24, 2024
@bobbinth bobbinth modified the milestones: v0.11.0, v0.12 Aug 7, 2024
@bobbinth
Copy link
Contributor

Superseded by changes in #1571.

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

No branches or pull requests

2 participants