@@ -9,7 +9,6 @@ use crate::util::heap::space_descriptor::SpaceDescriptor;
99use crate :: util:: int_array_freelist:: IntArrayFreeList ;
1010use crate :: util:: Address ;
1111use std:: cell:: UnsafeCell ;
12- use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
1312use std:: sync:: { Mutex , MutexGuard } ;
1413
1514pub struct Map32 {
@@ -27,12 +26,6 @@ pub struct Map32Inner {
2726 total_available_discontiguous_chunks : usize ,
2827 finalized : bool ,
2928 descriptor_map : Vec < SpaceDescriptor > ,
30-
31- // TODO: Is this the right place for this field?
32- // This used to be a global variable. When we remove global states, this needs to be put somewhere.
33- // Currently I am putting it here, as for where this variable is used, we already have
34- // references to vm_map - so it is convenient to put it here.
35- cumulative_committed_pages : AtomicUsize ,
3629}
3730
3831unsafe impl Send for Map32 { }
@@ -51,7 +44,6 @@ impl Map32 {
5144 total_available_discontiguous_chunks : 0 ,
5245 finalized : false ,
5346 descriptor_map : vec ! [ SpaceDescriptor :: UNINITIALIZED ; max_chunks] ,
54- cumulative_committed_pages : AtomicUsize :: new ( 0 ) ,
5547 } ) ,
5648 sync : Mutex :: new ( ( ) ) ,
5749 }
@@ -260,11 +252,6 @@ impl VMMap for Map32 {
260252 . copied ( )
261253 . unwrap_or ( SpaceDescriptor :: UNINITIALIZED )
262254 }
263-
264- fn add_to_cumulative_committed_pages ( & self , pages : usize ) {
265- self . cumulative_committed_pages
266- . fetch_add ( pages, Ordering :: Relaxed ) ;
267- }
268255}
269256
270257impl Map32 {
0 commit comments