Commit 8712492
authored
host-sp-messages: don't copy that floppy^H^H^H^H^H^HInventoryData (#2253)
The `InventoryData` enum in `host-sp-messages` is *real* big: at least
512B for the `DimmSpd` message, or perhaps more if one of the other
variants whose fields I didn't want to add up is more than that.
Currently, it `#[derive(Copy)]`s, which feels like a big stack overflow
footgun: if an `InventoryData` value is accidentally moved by value, it
gets copied on the stack. This kills the Hubris.
Thus, this commit just removes the `#[derive(Copy)]`, which should take
the bullets out of the footgun. Other `host-sp-messages` are left alone,
and everything still builds fine. While the `SpToHost` and `HostToSp`
messages also derive `Copy`, they aren't as big, and the `Copy` impl
is necessary because they get stuck in ringbufs.1 parent 674e868 commit 8712492
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
295 | 300 | | |
296 | | - | |
| 301 | + | |
297 | 302 | | |
298 | 303 | | |
299 | 304 | | |
| |||
0 commit comments