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 @@ -165,6 +165,15 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
165
165
None
166
166
}
167
167
}
168
+
169
+ #[ inline]
170
+ fn count ( self ) -> usize {
171
+ if !self . is_empty ( ) {
172
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
173
+ } else {
174
+ 0
175
+ }
176
+ }
168
177
}
169
178
170
179
impl < S : PageSize > fmt:: Debug for PhysFrameRange < S > {
Original file line number Diff line number Diff line change @@ -305,6 +305,15 @@ impl<S: PageSize> Iterator for PageRange<S> {
305
305
None
306
306
}
307
307
}
308
+
309
+ #[ inline]
310
+ fn count ( self ) -> usize {
311
+ if !self . is_empty ( ) {
312
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
313
+ } else {
314
+ 0
315
+ }
316
+ }
308
317
}
309
318
310
319
impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments