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 @@ -161,6 +161,15 @@ impl<S: PageSize> Iterator for PhysFrameRange<S> {
161
161
None
162
162
}
163
163
}
164
+
165
+ #[ inline]
166
+ fn count ( self ) -> usize {
167
+ if !self . is_empty ( ) {
168
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
169
+ } else {
170
+ 0
171
+ }
172
+ }
164
173
}
165
174
166
175
impl < S : PageSize > fmt:: Debug for PhysFrameRange < S > {
Original file line number Diff line number Diff line change @@ -324,6 +324,15 @@ impl<S: PageSize> Iterator for PageRange<S> {
324
324
None
325
325
}
326
326
}
327
+
328
+ #[ inline]
329
+ fn count ( self ) -> usize {
330
+ if !self . is_empty ( ) {
331
+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
332
+ } else {
333
+ 0
334
+ }
335
+ }
327
336
}
328
337
329
338
impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments