From fe11d205a5380d2cd66583b55fcceaacccab50b7 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 5 Mar 2013 17:45:31 +0000 Subject: [PATCH] Fix mistake in example code. Copied from Perforce Change: 181059 ServerID: perforce.ravenbrook.com --- mps/manual/source/topic/allocation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mps/manual/source/topic/allocation.rst b/mps/manual/source/topic/allocation.rst index 7bff1e40cb0..1d808828ccd 100644 --- a/mps/manual/source/topic/allocation.rst +++ b/mps/manual/source/topic/allocation.rst @@ -445,7 +445,7 @@ This example contains several mistakes. See the highlighted lines: struct link_s *prev; struct link_s *next; obj_t obj; - } link_s, link_t; + } link_s, *link_t; /* insert 'obj' into the doubly-linked list after 'head' */ link_t insert_link(link_t head, obj_t obj) @@ -476,7 +476,7 @@ The mistakes are: ``head->next`` becomes an exact reference to ``link``). This must be deferred until after a successful commit. -3. This line makes mistakes (1) and (2). +3. This line makes both mistakes made by lines (1) and (2). 4. The ``obj`` slot contains an exact reference that gets fixed by the scan method, so it must be initialized before the call to commit.