From c424e830cd4f22b9b3d06552818f2905107398bd Mon Sep 17 00:00:00 2001 From: krishvishal Date: Tue, 13 May 2025 16:57:44 +0530 Subject: [PATCH] Add safety documentation --- core/storage/btree.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/storage/btree.rs b/core/storage/btree.rs index da102a440..310d63b98 100644 --- a/core/storage/btree.rs +++ b/core/storage/btree.rs @@ -1023,6 +1023,10 @@ impl BTreeCursor { } } + /// This function read from a page into a buffer or write from a buffer into a page. + /// copy_to_page: true if writing, false if reading + /// SAFETY: This function uses unsafe in the write path to write to the page payload directly. + /// - Make sure the page is pointing to valid data ie the page is not evicted from the page-cache. fn read_write_payload_to_page( &mut self, payload_offset: u32,