1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-09 16:18:10 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
Roman Zeyde
8fbe005186 refactor(core): wrap coverage data map with spin::RwLock
It allows us to avoid the `unsafe` blocks (due to `static mut` references).

[no changelog]
2025-06-17 17:09:30 +03:00
Roman Zeyde
365116be52 refactor(core): use Qstr instead of StrBuffer in coverage::Key
It allows `coverage::Key` to be `Send` & `Sync` - otherwise,
wrapping coverage data with a `spin::Mutex` will fail due to:
```
error[E0277]: `*const u8` cannot be sent between threads safely
   --> src/coverage/mod.rs:49:23
    |
49  | static COVERAGE_DATA: Mutex<FnvIndexMap<Key, u64, { 1024 * 1024 }>> =
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
    |
    = help: within `IndexMap<Key, u64, hash32::BuildHasherDefault<hash32::fnv::Hasher>, 1048576>`, the trait `Send` is not implemented for `*const u8`
note: required because it appears within the type `StrBuffer`
```

[no changelog]
2025-06-17 17:09:30 +03:00
Roman Zeyde
64241033cb chore(core): move coverage-related Rust code into a separate module
Also, exclude it from non-debug builds.

[no changelog]
2025-05-30 19:26:51 +03:00