@@ -217,6 +217,8 @@ impl<T> TypedArena<T> {
217
217
218
218
#[ inline]
219
219
fn can_allocate ( & self , additional : usize ) -> bool {
220
+ // FIXME: this should *likely* use `offset_from`, but more
221
+ // investigation is needed (including running tests in miri).
220
222
let available_bytes = self . end . get ( ) . addr ( ) - self . ptr . get ( ) . addr ( ) ;
221
223
let additional_bytes = additional. checked_mul ( mem:: size_of :: < T > ( ) ) . unwrap ( ) ;
222
224
available_bytes >= additional_bytes
@@ -263,6 +265,8 @@ impl<T> TypedArena<T> {
263
265
// If a type is `!needs_drop`, we don't need to keep track of how many elements
264
266
// the chunk stores - the field will be ignored anyway.
265
267
if mem:: needs_drop :: < T > ( ) {
268
+ // FIXME: this should *likely* use `offset_from`, but more
269
+ // investigation is needed (including running tests in miri).
266
270
let used_bytes = self . ptr . get ( ) . addr ( ) - last_chunk. start ( ) . addr ( ) ;
267
271
last_chunk. entries = used_bytes / mem:: size_of :: < T > ( ) ;
268
272
}
@@ -300,6 +304,8 @@ impl<T> TypedArena<T> {
300
304
// Recall that `end` was incremented for each allocated value.
301
305
end - start
302
306
} else {
307
+ // FIXME: this should *likely* use `offset_from`, but more
308
+ // investigation is needed (including running tests in miri).
303
309
( end - start) / mem:: size_of :: < T > ( )
304
310
} ;
305
311
// Pass that to the `destroy` method.
0 commit comments