-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Labels
snapshotsFramework for BitTorrent-based snapshotsFramework for BitTorrent-based snapshots
Description
EliasFanoList32 potentially owns the data inside a data_holder_ property (as Bytes inside BytesOrByteView).
EliasFanoList32 contains spans that point somewhere inside that data: lower_bits_, upper_bits_, jump_.
These spans are initialized in derive_fields() method.
If EliasFanoList32 is moved, the spans potentially become dangling pointers, and accessing the list values might crash.
Potential solutions:
- Implement move constructor/assignment and call derive_fields() there to reassign spans. This has performance impact.
- Instead of using std::span, store an (offset, size) pair relative to the data_holder_ for each span (lower_bits_, upper_bits_, jump_). The spans can be created on demand using (offset, size). See data() method.
Metadata
Metadata
Assignees
Labels
snapshotsFramework for BitTorrent-based snapshotsFramework for BitTorrent-based snapshots