Thanks to visit codestin.com
Credit goes to github.com

Skip to content

w3vm: add VM.Clone#269

Merged
lmittmann merged 4 commits intolmittmann:mainfrom
zacksinclair:feat/w3vm-add-clone
Aug 8, 2025
Merged

w3vm: add VM.Clone#269
lmittmann merged 4 commits intolmittmann:mainfrom
zacksinclair:feat/w3vm-add-clone

Conversation

@zacksinclair
Copy link
Contributor

@zacksinclair zacksinclair commented Aug 4, 2025

Implements VM.Clone() with a variety of tests.

closes #267

w3vm/vm.go Outdated
}

// Clone creates a new VM with a copy of the current VM's options and a snapshot of its state.
func (vm *VM) Clone() (*VM, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer if the signature is simply

func (vm *VM) Clone() *VM

and if instead of using options and New just copy the opts and create a VM instance directly. For many attributes like the fetcher a shallow copy is completely fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

also rebased and squashed

@lmittmann lmittmann changed the title w3vm: clone w3vm: add VM.Clone Aug 7, 2025
@lmittmann lmittmann merged commit 3f242b8 into lmittmann:main Aug 8, 2025
4 checks passed
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.

Feature request: VM.Clone()

2 participants

Comments