File tree 2 files changed +15
-15
lines changed
2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -4567,7 +4567,7 @@ fn fill_cell_payload(
4567
4567
}
4568
4568
4569
4569
// we still have bytes to add, we will need to allocate new overflow page
4570
- let overflow_page = allocate_overflow_page ( pager. clone ( ) ) ;
4570
+ let overflow_page = pager. allocate_overflow_page ( ) ;
4571
4571
overflow_pages. push ( overflow_page. clone ( ) ) ;
4572
4572
{
4573
4573
let id = overflow_page. get ( ) . id as u32 ;
@@ -4590,20 +4590,6 @@ fn fill_cell_payload(
4590
4590
assert_eq ! ( cell_size, cell_payload. len( ) ) ;
4591
4591
}
4592
4592
4593
- /// Allocate a new overflow page.
4594
- /// This is done when a cell overflows and new space is needed.
4595
- fn allocate_overflow_page ( pager : Rc < Pager > ) -> PageRef {
4596
- let page = pager. allocate_page ( ) . unwrap ( ) ;
4597
- tracing:: debug!( "allocate_overflow_page(id={})" , page. get( ) . id) ;
4598
-
4599
- // setup overflow page
4600
- let contents = page. get ( ) . contents . as_mut ( ) . unwrap ( ) ;
4601
- let buf = contents. as_ptr ( ) ;
4602
- buf. fill ( 0 ) ;
4603
-
4604
- page
4605
- }
4606
-
4607
4593
/// Returns the maximum payload size (X) that can be stored directly on a b-tree page without spilling to overflow pages.
4608
4594
///
4609
4595
/// For table leaf pages: X = usable_size - 35
Original file line number Diff line number Diff line change @@ -217,6 +217,20 @@ impl Pager {
217
217
id as u32
218
218
}
219
219
220
+ /// Allocate a new overflow page.
221
+ /// This is done when a cell overflows and new space is needed.
222
+ pub fn allocate_overflow_page ( & self ) -> PageRef {
223
+ let page = self . allocate_page ( ) . unwrap ( ) ;
224
+ tracing:: debug!( "Pager::allocate_overflow_page(id={})" , page. get( ) . id) ;
225
+
226
+ // setup overflow page
227
+ let contents = page. get ( ) . contents . as_mut ( ) . unwrap ( ) ;
228
+ let buf = contents. as_ptr ( ) ;
229
+ buf. fill ( 0 ) ;
230
+
231
+ page
232
+ }
233
+
220
234
/// Allocate a new page to the btree via the pager.
221
235
/// This marks the page as dirty and writes the page header.
222
236
pub fn do_allocate_page ( & self , page_type : PageType , offset : usize ) -> PageRef {
You can’t perform that action at this time.
0 commit comments