Skip to content

Commit a074ee1

Browse files
committed
Add a comment for arena_types!
1 parent ef3db91 commit a074ee1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc/arena.rs

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ use std::cell::RefCell;
66
use std::marker::PhantomData;
77
use smallvec::SmallVec;
88

9+
/// This declares a list of types which can be allocated by `Arena`.
10+
///
11+
/// The `few` modifier will cause allocation to use the shared arena and recording the destructor.
12+
/// This is faster and more memory efficient if there's only a few allocations of the type.
13+
/// Leaving `few` out will cause the type to get its own dedicated `TypedArena` which is
14+
/// faster and more memory efficient if there is lots of allocations.
15+
///
16+
/// Specifying the `decode` modifier will add decode impls for &T and &[T] where T is the type
17+
/// listed. These impls will appear in the implement_ty_decoder! macro.
918
#[macro_export]
1019
macro_rules! arena_types {
1120
($macro:path, $args:tt, $tcx:lifetime) => (

0 commit comments

Comments
 (0)