@@ -93,11 +93,11 @@ impl Debug for RawContext {
93
93
impl RawContext {
94
94
pub ( crate ) unsafe fn from_collector ( collector : SimpleCollector ) -> ManuallyDrop < Box < Self > > {
95
95
assert ! (
96
- !collector. manager. has_existing_context
96
+ !collector. as_raw ( ) . manager. has_existing_context
97
97
. replace( true ) ,
98
98
"Already created a context for the collector!"
99
99
) ;
100
- let logger = collector. logger . new ( o ! ( ) ) ;
100
+ let logger = collector. as_raw ( ) . logger . new ( o ! ( ) ) ;
101
101
let context = ManuallyDrop :: new ( Box :: new ( RawContext {
102
102
logger : logger. clone ( ) , collector,
103
103
shadow_stack : UnsafeCell :: new ( ShadowStack {
@@ -128,9 +128,9 @@ impl RawContext {
128
128
* at a safepoint.
129
129
* This simplifies the implementation considerably.
130
130
*/
131
- assert ! ( !self . collector. collecting. get( ) ) ;
132
- self . collector . collecting . set ( true ) ;
133
- let collection_id = self . collector . state . borrow_mut ( )
131
+ assert ! ( !self . collector. as_raw ( ) . collecting. get( ) ) ;
132
+ self . collector . as_raw ( ) . collecting . set ( true ) ;
133
+ let collection_id = self . collector . as_raw ( ) . state . borrow_mut ( )
134
134
. next_pending_id ( ) ;
135
135
trace ! (
136
136
self . logger,
@@ -150,14 +150,14 @@ impl RawContext {
150
150
"shadow_stack" => FnValue ( |_| format!( "{:?}" , shadow_stack. as_vec( ) ) ) ,
151
151
"state" => ?self . state,
152
152
"collection_id" => collection_id,
153
- "original_size" => self . collector. heap. allocator. allocated_size( ) ,
153
+ "original_size" => self . collector. as_raw ( ) . heap. allocator. allocated_size( ) ,
154
154
) ;
155
- self . collector . perform_raw_collection ( & [ ptr] ) ;
155
+ self . collector . as_raw ( ) . perform_raw_collection ( & [ ptr] ) ;
156
156
assert_eq ! (
157
157
self . state. replace( ContextState :: Active ) ,
158
158
ContextState :: SafePoint { collection_id }
159
159
) ;
160
- assert ! ( self . collector. collecting. replace( false ) ) ;
160
+ assert ! ( self . collector. as_raw ( ) . collecting. replace( false ) ) ;
161
161
}
162
162
/// Borrow a reference to the shadow stack,
163
163
/// assuming this context is valid (not active).
0 commit comments