Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-cpython/src/revlog.rs @ 51254:ca81cd96000a
rust-index: add Sync bound to all relevant mmap-derived values
All readonly mmaps are Sync as far as Rust is concerned. Integrity of the
mmap'ed file is a concern separate to Rust's memory model, since it requires
out-of-program handling via locks, etc.
This will help when we start sharing the Rust Index with Python.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 26 Oct 2023 15:26:19 +0200 |
parents | 3551f2a1c963 |
children | 59183a19954e |
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs Tue Oct 31 18:09:43 2023 +0100 +++ b/rust/hg-cpython/src/revlog.rs Thu Oct 26 15:26:19 2023 +0200 @@ -520,7 +520,7 @@ data: PyObject, ) -> PyResult<( PyBuffer, - Box<dyn std::ops::Deref<Target = [u8]> + Send + 'static>, + Box<dyn std::ops::Deref<Target = [u8]> + Send + Sync + 'static>, )> { let buf = PyBuffer::get(py, &data)?; let len = buf.item_count();