Skip to content

Commit

Permalink
fixed tests for BTree. Fixed skiplist headerSize
Browse files Browse the repository at this point in the history
  • Loading branch information
noha committed Feb 16, 2024
1 parent 9f13053 commit 37d88e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Soil-Core/SoilBasicBTree.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ SoilBasicBTree >> flush [
self store flush
]

{ #category : #testing }
SoilBasicBTree >> hasHeaderPage [
^ store hasHeaderPage
]

{ #category : #initialization }
SoilBasicBTree >> initializeFilesystem [
self store initializeFilesystem
Expand Down
9 changes: 8 additions & 1 deletion src/Soil-Core/SoilSkipListHeaderPage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ SoilSkipListHeaderPage class >> pageCode [
{ #category : #utilities }
SoilSkipListHeaderPage >> headerSize [
^ super headerSize
+ 10 "keySize, valueSize, maxLevel, lastPageIndex"
+ 14 "keySize(2), valueSize(2), maxLevel(2), lastPageIndex(4), lastFreePageIndex(4)"
+ 1 "level"
+ (self level * self rightSize)
+ 2 "items size"
]

{ #category : #initialization }
SoilSkipListHeaderPage >> initialize [
super initialize.
lastPageIndex := 1.
lastFreePageIndex := 0
]

{ #category : #accessing }
SoilSkipListHeaderPage >> keySize: anInteger [
"as long as no items have been added the key size can be changed"
Expand Down

0 comments on commit 37d88e1

Please sign in to comment.