@@ -7,19 +7,19 @@ r[runtime.global_allocator]
77## The ` global_allocator ` attribute
88
99r[ runtime.global_allocator.intro]
10- The * ` global_allocator ` [ attribute] [ attributes ] * is used to define a [ memory allocator] [ std::alloc ] .
10+ The * ` global_allocator ` [ attribute] [ attributes ] * selects a [ memory allocator] [ std::alloc ] .
1111
1212> [ !EXAMPLE]
1313> ``` rust
14- > use std :: alloc :: {GlobalAlloc , System , Layout };
14+ > use core :: alloc :: {GlobalAlloc , Layout };
15+ > use std :: alloc :: System ;
1516>
1617> struct MyAllocator ;
1718>
1819> unsafe impl GlobalAlloc for MyAllocator {
1920> unsafe fn alloc (& self , layout : Layout ) -> * mut u8 {
2021> unsafe { System . alloc (layout ) }
2122> }
22- >
2323> unsafe fn dealloc (& self , ptr : * mut u8 , layout : Layout ) {
2424> unsafe { System . dealloc (ptr , layout ) }
2525> }
@@ -30,19 +30,19 @@ The *`global_allocator` [attribute][attributes]* is used to define a [memory all
3030> ```
3131
3232r [runtime . global_allocator. syntax]
33- The `global_allocator ` attribute uses the [MetaWord ] syntax and thus does not take any inputs .
33+ The `global_allocator ` attribute uses the [MetaWord ] syntax .
3434
3535r [runtime . global_allocator. allowed- positions ]
36- The `global_allocator ` attribute may only be applied to a [static item ] that implements the [`GlobalAlloc `] trait .
36+ The `global_allocator ` attribute may only be applied to a [static item ] whose type implements the [`GlobalAlloc `] trait .
3737
3838r [runtime . global_allocator. duplicates]
39- The `global_allocator ` attribute may only be specified once on an item .
39+ The `global_allocator ` attribute may only be used once on an item .
4040
4141r [runtime . global_allocator. single]
42- At most one `global_allocator ` may be specified in the crate graph .
42+ The `global_allocator ` attribute may only be used once in the crate graph .
4343
4444r [runtime . global_allocator. stdlib]
45- The `global_allocator ` attribute is exported in the [standard library prelude ][core :: prelude :: v1 ].
45+ The `global_allocator ` attribute is exported from the [standard library prelude ][core :: prelude :: v1 ].
4646
4747r [runtime . windows_subsystem]
4848## The `windows_subsystem ` attribute
0 commit comments