BIND 10 trac2831, updated. 67d05b954c47821d6a29ba093632604c49fb794c [2831] Add punctuation to better follow the documentation

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Apr 4 08:26:46 UTC 2013


The branch, trac2831 has been updated
       via  67d05b954c47821d6a29ba093632604c49fb794c (commit)
       via  2f6c7ab36c4c2c88bc19503a2bf5577d148cb71b (commit)
       via  8a09c89d47dd66c641809fadca16d29eb79c25f4 (commit)
       via  229916f0c84ee62b3c0f3c204d6b20dd3e8d3062 (commit)
      from  4a6f54f71484ebc8531371da819d4f98f59418e9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 67d05b954c47821d6a29ba093632604c49fb794c
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Apr 4 13:55:36 2013 +0530

    [2831] Add punctuation to better follow the documentation
    
    Also make a minor typo fix.

commit 2f6c7ab36c4c2c88bc19503a2bf5577d148cb71b
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Apr 4 13:53:49 2013 +0530

    [2831] Rearrange sentences in API doc comment

commit 8a09c89d47dd66c641809fadca16d29eb79c25f4
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Apr 4 13:53:03 2013 +0530

    [2831] Rename variable, and also update test condition

commit 229916f0c84ee62b3c0f3c204d6b20dd3e8d3062
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Apr 4 13:51:43 2013 +0530

    [2831] Make a coding style update

-----------------------------------------------------------------------

Summary of changes:
 src/lib/util/memory_segment.h         |   19 +++++++++----------
 src/lib/util/memory_segment_local.cc  |    4 ++--
 src/lib/util/memory_segment_mapped.cc |    3 +--
 src/lib/util/memory_segment_mapped.h  |   23 ++++++++++++-----------
 4 files changed, 24 insertions(+), 25 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/memory_segment.h b/src/lib/util/memory_segment.h
index f102587..171145d 100644
--- a/src/lib/util/memory_segment.h
+++ b/src/lib/util/memory_segment.h
@@ -22,7 +22,7 @@
 namespace isc {
 namespace util {
 
-/// \brief Exception that can be thrown on constructing a MemorySegment
+/// \brief Exception that can be thrown when constructing a MemorySegment
 /// object.
 class MemorySegmentOpenError : public Exception {
 public:
@@ -30,7 +30,7 @@ public:
         isc::Exception(file, line, what) {}
 };
 
-/// \brief Exception that is thrown when allocating a space in a MemorySegment
+/// \brief Exception that is thrown, when allocating space in a MemorySegment
 /// results in growing the underlying segment.
 ///
 /// See MemorySegment::allocate() for details.
@@ -50,14 +50,13 @@ public:
 
 /// \brief Memory Segment Class
 ///
-/// This class specifies an interface for allocating memory
-/// segments. This is an abstract class and a real
-/// implementation such as MemorySegmentLocal should be used
-/// in code.
-///
-/// It's intended to provide a unified interface whether the underlying
+/// This class specifies an interface for allocating memory segments.
+/// It's intended to provide a unified interface, whether the underlying
 /// memory is local to a specific process or is sharable by multiple
 /// processes.
+///
+/// This is an abstract class and a real implementation such as
+/// MemorySegmentLocal should be used in code.
 class MemorySegment {
 public:
     /// \brief Destructor
@@ -71,8 +70,8 @@ public:
     /// internal memory segment (again, in an implementation dependent way)
     /// to allocate the required size of memory.  In that case the
     /// implementation must grow the internal segment sufficiently so the
-    /// next call to allocate() for the same size will succeed and throw
-    /// an \c MemorySegmentGrown exception (not really allocating the memory
+    /// next call to allocate() for the same size will succeed, and throw
+    /// a \c MemorySegmentGrown exception (not really allocating the memory
     /// yet).
     ///
     /// An application that uses this memory segment abstraction to allocate
diff --git a/src/lib/util/memory_segment_local.cc b/src/lib/util/memory_segment_local.cc
index 1727a3d..52de66b 100644
--- a/src/lib/util/memory_segment_local.cc
+++ b/src/lib/util/memory_segment_local.cc
@@ -68,8 +68,8 @@ MemorySegmentLocal::setNamedAddress(const char* name, void* addr) {
 
 bool
 MemorySegmentLocal::clearNamedAddress(const char* name) {
-    const size_t n_erase = named_addrs_.erase(name);
-    return (n_erase == 1);
+    const size_t n_erased = named_addrs_.erase(name);
+    return (n_erased != 0);
 }
 
 } // namespace util
diff --git a/src/lib/util/memory_segment_mapped.cc b/src/lib/util/memory_segment_mapped.cc
index c3ae717..b1cd25b 100644
--- a/src/lib/util/memory_segment_mapped.cc
+++ b/src/lib/util/memory_segment_mapped.cc
@@ -64,8 +64,7 @@ struct MemorySegmentMapped::Impl {
         const size_t new_size = prev_size * 2;
         assert(new_size != 0); // assume grow fails before size overflow
 
-        if (!BaseSegment::grow(filename_.c_str(), new_size - prev_size))
-        {
+        if (!BaseSegment::grow(filename_.c_str(), new_size - prev_size)) {
             throw std::bad_alloc();
         }
 
diff --git a/src/lib/util/memory_segment_mapped.h b/src/lib/util/memory_segment_mapped.h
index e569738..cb91da0 100644
--- a/src/lib/util/memory_segment_mapped.h
+++ b/src/lib/util/memory_segment_mapped.h
@@ -40,7 +40,7 @@ namespace util {
 /// read-only and read-write objects that share the same mapped image;
 /// in fact, the expected usage is the application (or a system of related
 /// processes) ensures there's at most one read-write object and if there's
-/// such an object no read-only object shares the image.  If an application
+/// such an object, no read-only object shares the image.  If an application
 /// uses this class beyond that expectation, it's the application's
 /// responsibility to provide necessary synchronization between the processes.
 class MemorySegmentMapped : boost::noncopyable, public MemorySegment {
@@ -54,8 +54,8 @@ public:
     /// \brief Constructor in the read-only mode.
     ///
     /// This constructor will map the content of the given file into memory
-    /// in the "read only" mode; the resulting memory segment object cannot
-    /// be used with methods that would requite the mapped memory (see method
+    /// in read-only mode; the resulting memory segment object cannot
+    /// be used with methods that would require the mapped memory (see method
     /// descriptions).  Also, if the application tries to modify memory in
     /// the segment, it will make the application crash.
     ///
@@ -76,16 +76,17 @@ public:
     ///
     /// This is similar to the read-only version of the constructor, but
     /// does not have the restrictions that the read-only version has.
-    /// If \c create is true and the specified file does not exist, it tries
-    /// to create a new file of the name and build internal data on it so that
-    /// the file will be mappable by this class object.  If \c create is
-    /// false, the specified file must exist and be writable, and have been
-    /// previously initialized by this version of constructor with \c create
-    /// being true.  If any of these conditions is not met,
-    /// \c MemorySegmentOpenError exception will be thrown.
+    /// If \c create is true and the specified file does not exist, this
+    /// method tries to create a new file of the name and build internal
+    /// data on it so that the file will be mappable by this class
+    /// object.  If \c create is false, the specified file must exist
+    /// and be writable, and have been previously initialized by this
+    /// version of constructor with \c create being true.  If any of
+    /// these conditions is not met, \c MemorySegmentOpenError exception
+    /// will be thrown.
     ///
     /// \param filename The file name to be mapped to memory.
-    /// \param create If true and the file does not exist a new one is created.
+    /// \param create If true and the file does not exist, a new one is created.
     /// \param initial_size Specifies the size of the newly created file;
     /// ignored if \c create is false.
     MemorySegmentMapped(const std::string& filename, bool create,



More information about the bind10-changes mailing list