@@ -3950,16 +3950,16 @@ to each function as the task executes. A stack allocation is reclaimed when
39503950control leaves the frame containing it.
39513951
39523952The _ heap_ is a general term that describes two separate sets of boxes: managed
3953- boxes &mdash ; which may be subject to garbage collection &mdash ; and owned
3954- boxes. The lifetime of an allocation in the heap depends on the lifetime of
3955- the box values pointing to it. Since box values may themselves be passed in and
3956- out of frames, or stored in the heap, heap allocations may outlive the frame
3957- they are allocated within.
3953+ boxes &mdash ; which may be subject to garbage collection &mdash ; and boxes. The
3954+ lifetime of an allocation in the heap depends on the lifetime of the box values
3955+ pointing to it. Since box values may themselves be passed in and out of frames,
3956+ or stored in the heap, heap allocations may outlive the frame they are
3957+ allocated within.
39583958
39593959### Memory ownership
39603960
39613961A task owns all memory it can * safely* reach through local variables, as well
3962- as managed, owned boxes and references.
3962+ as managed, boxes and references.
39633963
39643964When a task sends a value that has the ` Send ` trait to another task, it loses
39653965ownership of the value sent and can no longer refer to it. This is statically
@@ -4013,23 +4013,22 @@ state. Subsequent statements within a function may or may not initialize the
40134013local variables. Local variables can be used only after they have been
40144014initialized; this is enforced by the compiler.
40154015
4016- ### Owned boxes
4016+ ### Boxes
40174017
4018- An _ owned box _ is a reference to a heap allocation holding another value,
4019- which is constructed by the prefix operator ` box ` . When the standard library is
4020- in use, the type of an owned box is ` std::owned::Box<T> ` .
4018+ An _ box _ is a reference to a heap allocation holding another value, which is
4019+ constructed by the prefix operator ` box ` . When the standard library is in use,
4020+ the type of an box is ` std::owned::Box<T> ` .
40214021
4022- An example of an owned box type and value:
4022+ An example of an box type and value:
40234023
40244024```
40254025let x: Box<int> = box 10;
40264026```
40274027
4028- Owned box values exist in 1:1 correspondence with their heap allocation,
4029- copying an owned box value makes a shallow copy of the pointer. Rust will
4030- consider a shallow copy of an owned box to move ownership of the value. After a
4031- value has been moved, the source location cannot be used unless it is
4032- reinitialized.
4028+ Box values exist in 1:1 correspondence with their heap allocation, copying an
4029+ box value makes a shallow copy of the pointer. Rust will consider a shallow
4030+ copy of an box to move ownership of the value. After a value has been moved,
4031+ the source location cannot be used unless it is reinitialized.
40334032
40344033```
40354034let x: Box<int> = box 10;
0 commit comments