BIND 10 trac2831, updated. 7ed3411dd5f0045b2eb877579a715de9892fc501 [2831] Rewrite message for better clarity

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Apr 8 14:07:08 UTC 2013


The branch, trac2831 has been updated
       via  7ed3411dd5f0045b2eb877579a715de9892fc501 (commit)
       via  86c303a0291366a0f3dc7918255f2708ff1409e9 (commit)
       via  29b1d8dc4aafc4f644b3acd36dd6ca1704c07543 (commit)
      from  639532ca50d317fdee78374be0e05c0c43ee2a0d (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 7ed3411dd5f0045b2eb877579a715de9892fc501
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Apr 8 19:34:50 2013 +0530

    [2831] Rewrite message for better clarity
    
    "out of segment address" can be misconstrued as running out of segment
    address space.

commit 86c303a0291366a0f3dc7918255f2708ff1409e9
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Apr 8 19:26:49 2013 +0530

    [2831] Some more minor comment updates

commit 29b1d8dc4aafc4f644b3acd36dd6ca1704c07543
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Apr 8 19:26:27 2013 +0530

    [2831] Use EXPECT_NE instead of EXPECT_TRUE for void* return

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

Summary of changes:
 src/lib/util/memory_segment_mapped.cc              |    2 +-
 src/lib/util/memory_segment_mapped.h               |   12 ++++++------
 .../util/tests/memory_segment_mapped_unittest.cc   |    3 ++-
 3 files changed, 9 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/memory_segment_mapped.cc b/src/lib/util/memory_segment_mapped.cc
index 3a90ccd..f1bd9c1 100644
--- a/src/lib/util/memory_segment_mapped.cc
+++ b/src/lib/util/memory_segment_mapped.cc
@@ -187,7 +187,7 @@ MemorySegmentMapped::setNamedAddress(const char* name, void* addr) {
     }
 
     if (addr && !impl_->base_sgmt_->belongs_to_segment(addr)) {
-        isc_throw(MemorySegmentError, "out of segment address: " << addr);
+        isc_throw(MemorySegmentError, "address is out of segment: " << addr);
     }
 
     bool grown = false;
diff --git a/src/lib/util/memory_segment_mapped.h b/src/lib/util/memory_segment_mapped.h
index b5baea1..3ced535 100644
--- a/src/lib/util/memory_segment_mapped.h
+++ b/src/lib/util/memory_segment_mapped.h
@@ -152,19 +152,19 @@ public:
 
     /// \brief Shrink the underlying mapped segment to actually used size.
     ///
-    /// It will be convenient when a large amount of memory is allocated
-    /// then deallocated from the segment in order to keep the resulting
-    /// segment a reasonable size.
+    /// When a large amount of memory is allocated and then deallocated
+    /// from the segment, this method can be used to keep the resulting
+    /// segment at a reasonable size.
     ///
-    /// This method works best effort basis, and does not guarantee any
-    /// specific result.
+    /// This method works by a best-effort basis, and does not guarantee
+    /// any specific result.
     ///
     /// This method is generally expected to be failure-free, but it's still
     /// possible to fail.  For example, the underlying file may not be writable
     /// at the time of shrink attempt; it also tries to remap the shrunk
     /// segment internally, and there's a small chance it could fail.
     /// In such a case it throws \c MemorySegmentError.  If it's thrown the
-    /// segment is not usable any more.
+    /// segment is not usable anymore.
     ///
     /// This method cannot be called if the segment object is created in the
     /// read-only mode; in that case InvalidOperation will be thrown.
diff --git a/src/lib/util/tests/memory_segment_mapped_unittest.cc b/src/lib/util/tests/memory_segment_mapped_unittest.cc
index 2592c12..d006fc4 100644
--- a/src/lib/util/tests/memory_segment_mapped_unittest.cc
+++ b/src/lib/util/tests/memory_segment_mapped_unittest.cc
@@ -214,7 +214,8 @@ TEST_F(MemorySegmentMappedTest, namedAddress) {
     std::memcpy(ptr16, &test_val16, sizeof(test_val16));
     EXPECT_FALSE(segment_->setNamedAddress("test address", ptr16));
     MemorySegmentMapped segment_ro(mapped_file);
-    EXPECT_TRUE(segment_ro.getNamedAddress("test address"));
+    EXPECT_NE(static_cast<void*>(NULL),
+              segment_ro.getNamedAddress("test address"));
     EXPECT_EQ(test_val16, *static_cast<const uint16_t*>(
                   segment_ro.getNamedAddress("test address")));
 



More information about the bind10-changes mailing list