BIND 10 trac2108_3, updated. f1f2184dc4023a2cdd4157aefd3bdafdb164d586 [2108] Pass memory segment to InMemoryClient constructor

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Sep 10 07:41:28 UTC 2012


The branch, trac2108_3 has been updated
       via  f1f2184dc4023a2cdd4157aefd3bdafdb164d586 (commit)
      from  dd5485e6973a8ebc6fc99727ac3bc8903c8fce3b (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 f1f2184dc4023a2cdd4157aefd3bdafdb164d586
Author: Mukund Sivaraman <muks at isc.org>
Date:   Mon Sep 10 13:11:13 2012 +0530

    [2108] Pass memory segment to InMemoryClient constructor

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

Summary of changes:
 src/lib/datasrc/memory/memory_client.cc            |   11 +++++++----
 src/lib/datasrc/memory/memory_client.h             |    5 ++++-
 .../datasrc/memory/tests/memory_client_unittest.cc |    2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/memory_client.cc b/src/lib/datasrc/memory/memory_client.cc
index 7758e3c..5617690 100644
--- a/src/lib/datasrc/memory/memory_client.cc
+++ b/src/lib/datasrc/memory/memory_client.cc
@@ -87,7 +87,9 @@ private:
     };
 
 public:
-    InMemoryClientImpl(RRClass rrclass) :
+    InMemoryClientImpl(util::MemorySegment& mem_sgmt,
+                       RRClass rrclass) :
+        local_mem_sgmt_(mem_sgmt),
         rrclass_(rrclass),
         zone_count_(0),
         zone_table_(ZoneTable::create(local_mem_sgmt_, rrclass)),
@@ -106,7 +108,7 @@ public:
     // Memory segment to allocate/deallocate memory for the zone table.
     // (This will eventually have to be abstract; for now we hardcode the
     // specific derived segment class).
-    util::MemorySegmentLocal local_mem_sgmt_;
+    util::MemorySegment& local_mem_sgmt_;
     const RRClass rrclass_;
     unsigned int zone_count_;
     ZoneTable* zone_table_;
@@ -671,8 +673,9 @@ generateRRsetFromIterator(ZoneIterator* iterator, LoadCallback callback) {
 }
 }
 
-InMemoryClient::InMemoryClient(RRClass rrclass) :
-    impl_(new InMemoryClientImpl(rrclass))
+InMemoryClient::InMemoryClient(util::MemorySegment& mem_sgmt,
+                               RRClass rrclass) :
+    impl_(new InMemoryClientImpl(mem_sgmt, rrclass))
 {}
 
 InMemoryClient::~InMemoryClient() {
diff --git a/src/lib/datasrc/memory/memory_client.h b/src/lib/datasrc/memory/memory_client.h
index 0c211c1..a281259 100644
--- a/src/lib/datasrc/memory/memory_client.h
+++ b/src/lib/datasrc/memory/memory_client.h
@@ -15,6 +15,8 @@
 #ifndef DATASRC_MEMORY_CLIENT_H
 #define DATASRC_MEMORY_CLIENT_H 1
 
+#include <util/memory_segment.h>
+
 #include <datasrc/iterator.h>
 #include <datasrc/client.h>
 #include <datasrc/memory/zone_table.h>
@@ -62,7 +64,8 @@ public:
     /// This constructor internally involves resource allocation, and if
     /// it fails, a corresponding standard exception will be thrown.
     /// It never throws an exception otherwise.
-    InMemoryClient(isc::dns::RRClass rrclass);
+    InMemoryClient(util::MemorySegment& mem_sgmt,
+                   isc::dns::RRClass rrclass);
 
     /// The destructor.
     ~InMemoryClient();
diff --git a/src/lib/datasrc/memory/tests/memory_client_unittest.cc b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
index b86a3bd..0290a28 100644
--- a/src/lib/datasrc/memory/tests/memory_client_unittest.cc
+++ b/src/lib/datasrc/memory/tests/memory_client_unittest.cc
@@ -107,7 +107,7 @@ public:
 class MemoryClientTest : public ::testing::Test {
 protected:
     MemoryClientTest() : zclass_(RRClass::IN()),
-                         client_(new InMemoryClient(zclass_))
+                         client_(new InMemoryClient(mem_sgmt_, zclass_))
     {}
     ~MemoryClientTest() {
         if (client_ != NULL) {



More information about the bind10-changes mailing list