Browse Source

[2831] corrected example code in doc

JINMEI Tatuya 12 years ago
parent
commit
ecc1ba7e65
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/lib/util/memory_segment.h

+ 2 - 2
src/lib/util/memory_segment.h

@@ -87,8 +87,8 @@ public:
     /// multiple calls to \c allocate():
     ///
     /// \code
-    /// ComplicatedStuff* stuff;
-    /// while (true) { // this must eventually succeed or result in bad_alloc
+    /// ComplicatedStuff* stuff = NULL;
+    /// while (!stuff) { // this must eventually succeed or result in bad_alloc
     ///     try {
     ///         // create() is a factory method, takes a memory segment
     ///         // and calls allocate() on it multiple times.  create()