Per-component borrow checking
- Ngôn ngữ chính
- Rust
- Star
- 1.7k
- Fork
- 140
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Currently, runtime borrow checking is performed in order to allow the user to access two different components at the same time (which rust's static borrow checking would not allow), but disallow the same component from being incorrecttly borrowed multiple times.
The runtime state of a component's borrow is stored as an atomic integer along with each component's slice in each chunk. This is efficient and allows us to include borrow checking in release builds (although this is currently not the case) without significant performance penalty.
However, it is overly strict. It will not allow two components of the same type to be accessed at the same time when they each belong to different entities - even though this should be safe. This makes random component access very difficult in many situations.
We could relax these borrowing restrictions by tracking borrow state for every component, rather than each component slice. However, it is unlikely that this would provide acceptable performance, so we almost certainly would have to disable runtime borrow checking in release builds (perhaps with an opt-in).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.