changeset 51207:8ade5e6cdb61

rust-mixed-index: rename variable to make the next change clearer We're going to add another mmap reference holder, so let's rename this one first.
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 29 Jun 2023 15:00:46 +0200
parents a6e293b21743
children 8c4e8d06432e
files rust/hg-cpython/src/revlog.rs
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-cpython/src/revlog.rs	Wed Sep 27 10:08:32 2023 +0200
+++ b/rust/hg-cpython/src/revlog.rs	Thu Jun 29 15:00:46 2023 +0200
@@ -39,7 +39,7 @@
     data nt: RefCell<Option<NodeTree>>;
     data docket: RefCell<Option<PyObject>>;
     // Holds a reference to the mmap'ed persistent nodemap data
-    data mmap: RefCell<Option<PyBuffer>>;
+    data nodemap_mmap: RefCell<Option<PyBuffer>>;
 
     def __new__(_cls, cindex: PyObject) -> PyResult<MixedIndex> {
         Self::new(py, cindex)
@@ -175,7 +175,7 @@
     def clearcaches(&self, *args, **kw) -> PyResult<PyObject> {
         self.nt(py).borrow_mut().take();
         self.docket(py).borrow_mut().take();
-        self.mmap(py).borrow_mut().take();
+        self.nodemap_mmap(py).borrow_mut().take();
         self.call_cindex(py, "clearcaches", args, kw)
     }
 
@@ -447,7 +447,7 @@
 
         // Keep a reference to the mmap'ed buffer, otherwise we get a dangling
         // pointer.
-        self.mmap(py).borrow_mut().replace(buf);
+        self.nodemap_mmap(py).borrow_mut().replace(buf);
 
         let mut nt = NodeTree::load_bytes(Box::new(bytes), len);