File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use std::ffi::c_void;
15
15
use std:: alloc:: Layout ;
16
16
17
17
use zerogc:: { GcSafe , Trace } ;
18
- use zerogc:: vec:: repr:: { GcVecRepr , ReallocFailedError } ;
18
+ use zerogc:: vec:: repr:: { GcVecRepr , } ;
19
19
20
20
use zerogc_context:: field_offset;
21
21
use zerogc_derive:: { NullTrace , unsafe_gc_impl} ;
@@ -259,13 +259,6 @@ pub struct SimpleVecRepr<T: GcSafe> {
259
259
marker : PhantomData < T > ,
260
260
}
261
261
impl < T : GcSafe > SimpleVecRepr < T > {
262
- /// Get the in-memory layout for a [SimpleVecRepr],
263
- /// including its header
264
- #[ inline]
265
- pub fn layout ( capacity : usize ) -> Layout {
266
- Layout :: new :: < GcVecHeader > ( )
267
- . extend ( Layout :: array :: < T > ( capacity) . unwrap ( ) ) . unwrap ( ) . 0
268
- }
269
262
#[ inline]
270
263
fn header ( & self ) -> * mut GcVecHeader {
271
264
unsafe {
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ unsafe impl RawSimpleAlloc for RawSimpleCollector {
197
197
}
198
198
let ( header, value_ptr) = context. collector ( ) . heap . allocator . alloc_layout (
199
199
GcVecHeader :: LAYOUT ,
200
- SimpleVecRepr :: < T > :: layout ( capacity) ,
200
+ Layout :: array :: < T > ( capacity) . unwrap ( ) ,
201
201
<T as StaticVecType >:: STATIC_VEC_TYPE
202
202
) ;
203
203
let ptr = unsafe {
@@ -266,6 +266,7 @@ struct GcHeap {
266
266
config : Arc < GcConfig > ,
267
267
threshold : AtomicUsize ,
268
268
allocator : SimpleAlloc ,
269
+ // TODO: This needs to be traced!!
269
270
cached_empty_vec : Cell < Option < * mut GcVecHeader > >
270
271
}
271
272
impl GcHeap {
You can’t perform that action at this time.
0 commit comments