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> {
163163 None
164164 }
165165 }
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+ }
166175}
167176
168177impl < 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> {
309309 None
310310 }
311311 }
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+ }
312321}
313322
314323impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments