regalloc2 icon indicating copy to clipboard operation
regalloc2 copied to clipboard

refactor: use `&'static [PReg]` instead of `Vec<PReg>`

Open JonasKruckenberg opened this issue 1 year ago • 2 comments

This PR makes MachineEnv use &'static [PReg] instead of Vec<PReg> to make it possible to place MachineEnv into statics as part of https://github.com/bytecodealliance/wasmtime/pull/8489.

Edit: as it turns out serialization makes this not quite as trivial, serde can't deserialize into slices (had forgotten that) so I introduced a new SerializableMachineEnv type in the spirit of SerializableFunction to let consumers still serialize a machine env if required.

related: #177.

JonasKruckenberg avatar Jan 13 '25 08:01 JonasKruckenberg

Hmm seems libfuzz doesn't like Vec::leak?

JonasKruckenberg avatar Jan 13 '25 10:01 JonasKruckenberg

Hmm seems libfuzz doesn't like Vec::leak?

interestingly I locally can't replicate the CI fail

JonasKruckenberg avatar Jan 13 '25 10:01 JonasKruckenberg