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 @@ -296,6 +296,15 @@ impl<S: PageSize> Iterator for PageRange<S> {
296296 None
297297 }
298298 }
299+
300+ #[ inline]
301+ fn count ( self ) -> usize {
302+ if !self . is_empty ( ) {
303+ ( ( self . end . start_address ( ) - self . start . start_address ( ) ) / S :: SIZE ) as usize
304+ } else {
305+ 0
306+ }
307+ }
299308}
300309
301310impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments