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> {
161161 None
162162 }
163163 }
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+ }
164173}
165174
166175impl < 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> {
324324 None
325325 }
326326 }
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+ }
327336}
328337
329338impl PageRange < Size2MiB > {
You can’t perform that action at this time.
0 commit comments