Skip to content

Commit

Permalink
Further revisions suggested by nmatsakis (#2990).
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed Jul 23, 2012
1 parent d9cbdf7 commit 019a41b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -1197,15 +1197,14 @@ Rust has three competing goals that inform its view of memory:

## How performance considerations influence the memory model

Many languages that offer the kinds of memory safety guarantees that
Rust does have a single allocation strategy: objects live on the heap,
live for as long as they are needed, and are periodically
garbage-collected. This approach is straightforward both in concept
and in implementation, but has significant costs. Languages that take
this approach tend to aggressively pursue ways to ameliorate
allocation costs (think the Java Virtual Machine). Rust supports this
strategy with _shared boxes_: memory allocated on the heap that may be
referred to (shared) by multiple variables.
Most languages that offer strong memory safety guarantees rely upon a
garbage-collected heap to manage all of the objects. This approach is
straightforward both in concept and in implementation, but has
significant costs. Languages that take this approach tend to
aggressively pursue ways to ameliorate allocation costs (think the
Java Virtual Machine). Rust supports this strategy with _shared
boxes_: memory allocated on the heap that may be referred to (shared)
by multiple variables.

By comparison, languages like C++ offer very precise control over
where objects are allocated. In particular, it is common to put them
Expand Down

0 comments on commit 019a41b

Please sign in to comment.