-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Allow loading non-static snapshots #4402
Comments
Makes total sense... Great idea and contribution! |
@mathiasrw FTR: I'm not sure if my change will help a lot with that feature. I don't have a public project using this. We're using Deno internally in a very large project. The basic usage of this change is like this: use deno_core::{CoreIsolate, StartupData, Snapshot};
let bytes: Vec<u8> = /* load me from file or somewhere else */;
let boxed = bytes.into_boxed_slice();
let isolate = CoreIsolate::new(StartupData::Snapshot(Snapshot:Boxed(boxed)), false); |
@mraerino Thank you for the input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using
deno_core
inside my own library.I would like to be able to load snapshots from binary blobs at runtime.
They could be coming from a local file or the network.
This is currently blocked by the fact that Snapshots need a static lifetime.
In v8::CreateParams.set_snapshot_blob there is a restriction for the lifetime of a snapshot and I imagine that's why a
static
lifetime was chosen forv8::StartupData
:I think it should be enough to make it live as long as the isolate, right?
From a comment in #4403:
The text was updated successfully, but these errors were encountered: