@@ -6,9 +6,9 @@ use std::fmt::{self, Debug, Formatter};
6
6
7
7
use slog:: { Logger , o} ;
8
8
9
- use zerogc:: { Gc , GcSafe , GcSystem , Trace , GcSimpleAlloc , GcBrand , GcHandle , GcHandleSystem } ;
9
+ use zerogc:: { Gc , GcSafe , GcSystem , Trace , GcSimpleAlloc } ;
10
10
11
- use crate :: { SimpleCollectorContext , CollectionManager } ;
11
+ use crate :: { CollectorContext , CollectionManager } ;
12
12
13
13
/// A specific implementation of a collector
14
14
pub unsafe trait RawCollectorImpl : ' static + Sized {
@@ -205,9 +205,9 @@ impl<C: RawCollectorImpl> WeakCollectorRef<C> {
205
205
}
206
206
207
207
pub unsafe trait RawSimpleAlloc : RawCollectorImpl {
208
- fn alloc < ' gc , T : GcSafe + ' gc > ( context : & ' gc SimpleCollectorContext < Self > , value : T ) -> Gc < ' gc , T , CollectorId < Self > > ;
208
+ fn alloc < ' gc , T : GcSafe + ' gc > ( context : & ' gc CollectorContext < Self > , value : T ) -> Gc < ' gc , T , CollectorId < Self > > ;
209
209
}
210
- unsafe impl < ' gc , T , C > GcSimpleAlloc < ' gc , T > for SimpleCollectorContext < C >
210
+ unsafe impl < ' gc , T , C > GcSimpleAlloc < ' gc , T > for CollectorContext < C >
211
211
where T : GcSafe + ' gc , C : RawSimpleAlloc {
212
212
#[ inline]
213
213
fn alloc ( & ' gc self , value : T ) -> Gc < ' gc , T , Self :: Id > {
@@ -282,18 +282,18 @@ impl<C: RawCollectorImpl> CollectorRef<C> {
282
282
/// Warning: Only one collector should be created per thread.
283
283
/// Doing otherwise can cause deadlocks/panics.
284
284
#[ cfg( feature = "sync" ) ]
285
- pub fn create_context ( & self ) -> SimpleCollectorContext < C > {
286
- unsafe { SimpleCollectorContext :: register_root ( & self ) }
285
+ pub fn create_context ( & self ) -> CollectorContext < C > {
286
+ unsafe { CollectorContext :: register_root ( & self ) }
287
287
}
288
288
/// Convert this collector into a unique context
289
289
///
290
290
/// The single-threaded implementation only allows a single context,
291
291
/// so this method is nessicarry to support it.
292
- pub fn into_context ( self ) -> SimpleCollectorContext < C > {
292
+ pub fn into_context ( self ) -> CollectorContext < C > {
293
293
#[ cfg( feature = "sync" ) ]
294
294
{ self . create_context ( ) }
295
295
#[ cfg( not( feature = "sync" ) ) ]
296
- unsafe { SimpleCollectorContext :: from_collector ( & self ) }
296
+ unsafe { CollectorContext :: from_collector ( & self ) }
297
297
}
298
298
}
299
299
impl < C : RawCollectorImpl > Drop for CollectorRef < C > {
@@ -306,32 +306,5 @@ impl<C: RawCollectorImpl> Drop for CollectorRef<C> {
306
306
307
307
unsafe impl < C : RawCollectorImpl > GcSystem for CollectorRef < C > {
308
308
type Id = CollectorId < C > ;
309
- type Context = SimpleCollectorContext < C > ;
310
- }
311
-
312
- unsafe impl < ' gc , T , C > GcHandleSystem < ' gc , T > for CollectorRef < C >
313
- where C : RawHandleImpl < ' gc , T > ,
314
- T : GcSafe + ' gc ,
315
- T : GcBrand < ' static , CollectorId < C > > ,
316
- T :: Branded : GcSafe {
317
- type Handle = C :: Handle ;
318
-
319
- #[ inline]
320
- fn create_handle ( gc : Gc < ' gc , T , Self :: Id > ) -> Self :: Handle {
321
- C :: create_handle ( gc)
322
- }
323
- }
324
-
325
- pub unsafe trait RawHandleImpl < ' gc , T > : RawCollectorImpl
326
- where T : GcSafe + ' gc ,
327
- T : GcBrand < ' static , CollectorId < Self > > ,
328
- <T as GcBrand < ' static , CollectorId < Self > > >:: Branded : GcSafe {
329
- /// The type of handles to the object `T`.
330
- type Handle : GcHandle < <T as GcBrand < ' static , CollectorId < Self > > >:: Branded , System =CollectorRef < Self > > ;
331
-
332
- /// Create a handle to the specified GC pointer,
333
- /// which can be used without a context
334
- ///
335
- /// The system is implicit in the [Gc]
336
- fn create_handle ( gc : Gc < ' gc , T , CollectorId < Self > > ) -> Self :: Handle ;
309
+ type Context = CollectorContext < C > ;
337
310
}
0 commit comments