File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,15 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
163
163
None
164
164
}
165
165
}
166
+
167
+ #[ inline]
168
+ fn count ( self ) -> usize {
169
+ if !self . is_empty ( ) {
170
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
171
+ } else {
172
+ 0
173
+ }
174
+ }
166
175
}
167
176
168
177
impl < S : PageSize > fmt:: Debug for PhysFrameRange < S > {
Original file line number Diff line number Diff line change @@ -309,6 +309,15 @@ impl<S: PageSize> Iterator for PageRange<S> {
309
309
None
310
310
}
311
311
}
312
+
313
+ #[ inline]
314
+ fn count ( self ) -> usize {
315
+ if !self . is_empty ( ) {
316
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
317
+ } else {
318
+ 0
319
+ }
320
+ }
312
321
}
313
322
314
323
impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments