summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-04-13 18:45:35 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-04-13 18:45:35 +0000
commit12a747c705440a6e8e9adf7b97d9d30a86616f32 (patch)
tree0e241efb62d86e928668521585eddb7a75d27feb
parenta1da97350d9ed1749bba375d31d72ab97006090c (diff)
downloadATCD-12a747c705440a6e8e9adf7b97d9d30a86616f32.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-97a23
-rw-r--r--README2
-rw-r--r--ace/Connector.cpp21
-rw-r--r--ace/Malloc.h8
-rw-r--r--ace/Malloc.i7
-rw-r--r--ace/Malloc_T.cpp11
-rw-r--r--ace/Malloc_T.h7
-rw-r--r--ace/Synch.h6
-rw-r--r--examples/Shared_Malloc/test_malloc.cpp7
-rw-r--r--netsvcs/lib/Server_Logging_Handler.cpp22
10 files changed, 90 insertions, 24 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a
index e371eacf29f..3968f6ff032 100644
--- a/ChangeLog-97a
+++ b/ChangeLog-97a
@@ -1,3 +1,26 @@
+Sun Apr 13 11:40:26 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu>
+
+ * netsvcs/lib/Server_Logging_Handler.cpp: Replaced the use of
+ ACE_TLI* with LOGGING_PEER*. Thanks to Tom Wright
+ <twright@gem-net.demon.co.uk> for reporting this.
+
+ * ace/Connector.cpp: Made sure to initialize all of the instance
+ variables for the ACE_Strategy_Connector and ACE_Connector.
+ Thanks to David Levine for pointing this out.
+
+ * ace/Synch.h: Changed protected: to private: so that we can
+ ensure that we never copy classes like ACE_File_Lock, etc.
+ Thanks to Berni Merkle <merkle@io.freinet.de> for reporting
+ this.
+
+ * examples/Shared_Malloc/test_malloc.cpp (malloc_recurse): Added
+ the print_stats() call back into the test since Sandro's fixes
+ should now support this.
+
+ * ace/Malloc[_T]: Added patches to enable ACE_Allocator's to print
+ malloc statistics. Thanks to Sandro Doro
+ <alex@aureus.sublink.org> for these fixes.
+
Sat Apr 12 20:42:11 1997 David L. Levine <levine@cs.wustl.edu>
* tests/Priority_Task_Test.cpp (open): only use THR_SCHED_FIFO
diff --git a/README b/README
index 9430a953bba..56590ef11c8 100644
--- a/README
+++ b/README
@@ -496,6 +496,8 @@ Eric Dean Russell <edrusse@somnet.sandia.gov>
Daniel Montalibet <daniel_montalibet@stortek.com>
Norbert Rapp <norbert.rapp@nexus-informatics.de>
Ganesh Pai <gpai@voicetek.com>
+Berni Merkle <merkle@io.freinet.de>
+Tom Wright <twright@gem-net.demon.co.uk>
I would particularly like to thank Paul Stephenson, who worked with me
at Ericsson and is now at ObjectSpace. Paul devised the recursive
diff --git a/ace/Connector.cpp b/ace/Connector.cpp
index 00335e83dbf..b3986a36018 100644
--- a/ace/Connector.cpp
+++ b/ace/Connector.cpp
@@ -92,6 +92,14 @@ ACE_Connector<SH, PR_CO_2>::open (ACE_Reactor *r)
return 0;
}
+template <class SH, PR_CO_1>
+ACE_Connector<SH, PR_CO_2>::ACE_Connector (ACE_Reactor *r)
+ :
+{
+ ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::ACE_Connector");
+ this->open (r);
+}
+
// Register the SVC_HANDLER with the map of pending connections so
// that it can be activated when the connection completes.
@@ -176,13 +184,6 @@ ACE_Svc_Tuple<SH>::dump (void) const
ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
}
-template <class SH, PR_CO_1>
-ACE_Connector<SH, PR_CO_2>::ACE_Connector (ACE_Reactor *r)
-{
- ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::ACE_Connector");
- this->reactor (r);
-}
-
// This method is called if a connection times out before completing.
// In this case, we call our cleanup_AST() method to cleanup the
// descriptor from the ACE_Connector's table.
@@ -585,6 +586,12 @@ ACE_Strategy_Connector<SH, PR_CO_2>::ACE_Strategy_Connector
ACE_Creation_Strategy<SVC_HANDLER> *cre_s,
ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> *conn_s,
ACE_Concurrency_Strategy<SVC_HANDLER> *con_s)
+ : creation_strategy_ (0),
+ delete_creation_strategy_ (0),
+ connect_strategy_ (0),
+ delete_connect_strategy_ (0),
+ concurrency_strategy_ (0),
+ delete_concurrency_strategy_ (0)
{
ACE_TRACE ("ACE_Connector<SH, PR_CO_2>::ACE_Connector");
diff --git a/ace/Malloc.h b/ace/Malloc.h
index 15d56421db4..4b712d13ea6 100644
--- a/ace/Malloc.h
+++ b/ace/Malloc.h
@@ -100,6 +100,11 @@ public:
// Change the protection of the pages of the mapped region to <prot>
// starting at <addr> up to <len> bytes.
+#if defined (ACE_MALLOC_STATS)
+ virtual void print_stats (void) const = 0;
+ // Dump statistics of how malloc is behaving.
+#endif /* ACE_MALLOC_STATS */
+
virtual void dump (void) const = 0;
// Dump the state of the object.
};
@@ -255,6 +260,9 @@ public:
virtual int sync (void *addr, size_t len, int flags = MS_SYNC);
virtual int protect (ssize_t len = -1, int prot = PROT_RDWR);
virtual int protect (void *addr, size_t len, int prot = PROT_RDWR);
+#if defined (ACE_MALLOC_STATS)
+ virtual void print_stats (void) const;
+#endif /* ACE_MALLOC_STATS */
virtual void dump (void) const;
};
diff --git a/ace/Malloc.i b/ace/Malloc.i
index f22896fe79b..ba4b34d51b7 100644
--- a/ace/Malloc.i
+++ b/ace/Malloc.i
@@ -97,6 +97,13 @@ ACE_New_Allocator::protect (void *, size_t, int)
return -1;
}
+#if defined (ACE_MALLOC_STATS)
+ACE_INLINE void
+ACE_New_Allocator::print_stats (void) const
+{
+}
+#endif /* ACE_MALLOC_STATS */
+
ACE_INLINE void
ACE_New_Allocator::dump (void) const
{
diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp
index b73a522bc4d..362743f6842 100644
--- a/ace/Malloc_T.cpp
+++ b/ace/Malloc_T.cpp
@@ -26,6 +26,15 @@ ACE_Allocator_Adapter<MALLOC>::~ACE_Allocator_Adapter (void)
ACE_TRACE ("ACE_Allocator_Adapter<MALLOC>::~ACE_Allocator_Adapter");
}
+#if defined (ACE_MALLOC_STATS)
+template <class MALLOC> void
+ACE_Allocator_Adapter<MALLOC>::print_stats (void) const
+{
+ ACE_TRACE ("ACE_Malloc<MALLOC>::print_stats");
+ this->allocator_.print_stats ();
+}
+#endif /* ACE_MALLOC_STATS */
+
template <class MALLOC> void
ACE_Allocator_Adapter<MALLOC>::dump (void) const
{
@@ -51,7 +60,7 @@ ACE_Malloc<ACE_MEM_POOL_2, LOCK>::dump (void) const
#if defined (ACE_MALLOC_STATS)
template <ACE_MEM_POOL_1, class LOCK> void
-ACE_Malloc<ACE_MEM_POOL_2, LOCK>::print_stats (void)
+ACE_Malloc<ACE_MEM_POOL_2, LOCK>::print_stats (void) const
{
ACE_TRACE ("ACE_Malloc<ACE_MEM_POOL_2, LOCK>::print_stats");
ACE_GUARD (LOCK, ace_mon, this->lock_);
diff --git a/ace/Malloc_T.h b/ace/Malloc_T.h
index 1616e963459..ddc5423a3f0 100644
--- a/ace/Malloc_T.h
+++ b/ace/Malloc_T.h
@@ -127,6 +127,11 @@ public:
ALLOCATOR &alloc (void);
// Returns the underlying allocator.
+#if defined (ACE_MALLOC_STATS)
+ virtual void print_stats (void) const;
+ // Dump statistics of how malloc is behaving.
+#endif /* ACE_MALLOC_STATS */
+
virtual void dump (void) const;
// Dump the state of the object.
@@ -271,7 +276,7 @@ public:
// that would fit in the currently allocated memory.
#if defined (ACE_MALLOC_STATS)
- void print_stats (void);
+ void print_stats (void) const;
// Dump statistics of how malloc is behaving.
#endif /* ACE_MALLOC_STATS */
diff --git a/ace/Synch.h b/ace/Synch.h
index 5d12739db90..1e605c23526 100644
--- a/ace/Synch.h
+++ b/ace/Synch.h
@@ -144,7 +144,7 @@ public:
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.
-protected:
+private:
ACE_OS::ace_flock_t lock_;
// Locking structure for OS record locks.
@@ -592,7 +592,7 @@ public:
int release (void) { return 0; }
void dump (void) const { }
-protected:
+private:
// = Prevent assignment and initialization.
void operator= (const ACE_Null_Mutex_Guard &) {}
ACE_Null_Mutex_Guard (const ACE_Null_Mutex_Guard &) {}
@@ -854,7 +854,7 @@ public:
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.
-protected:
+private:
ACE_Thread_Mutex &lock_;
// Reference to the mutex.
diff --git a/examples/Shared_Malloc/test_malloc.cpp b/examples/Shared_Malloc/test_malloc.cpp
index 57e8899d68a..41646d0105b 100644
--- a/examples/Shared_Malloc/test_malloc.cpp
+++ b/examples/Shared_Malloc/test_malloc.cpp
@@ -29,7 +29,12 @@ malloc_recurse (int count)
{
static char default_char = 0;
- if (count > 0)
+ if (count <= 0)
+ {
+ if (Options::instance ()->debug ())
+ AMS (Malloc::instance ()->print_stats ());
+ }
+ else
{
int alloc_size = gen_size ();
void *ptr = Malloc::instance ()->malloc (alloc_size);
diff --git a/netsvcs/lib/Server_Logging_Handler.cpp b/netsvcs/lib/Server_Logging_Handler.cpp
index 32fbfb81249..cdf34c24ead 100644
--- a/netsvcs/lib/Server_Logging_Handler.cpp
+++ b/netsvcs/lib/Server_Logging_Handler.cpp
@@ -436,24 +436,24 @@ ACE_Thr_Server_Logging_Handler::svc (void)
}
#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Acceptor<ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH>, ACE_TLI_ACCEPTOR>;
-template class ACE_Acceptor<ACE_Thr_Server_Logging_Handler, ACE_TLI_ACCEPTOR>;
-template class ACE_Accept_Strategy<ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH>, ACE_TLI_ACCEPTOR>;
-template class ACE_Accept_Strategy<ACE_Thr_Server_Logging_Handler, ACE_TLI_ACCEPTOR>;
-template class ACE_Concurrency_Strategy<ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH> >;
+template class ACE_Acceptor<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH>, LOGGING_PEER_ACCEPTOR>;
+template class ACE_Acceptor<ACE_Thr_Server_Logging_Handler, LOGGING_PEER_ACCEPTOR>;
+template class ACE_Accept_Strategy<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH>, LOGGING_PEER_ACCEPTOR>;
+template class ACE_Accept_Strategy<ACE_Thr_Server_Logging_Handler, LOGGING_PEER_ACCEPTOR>;
+template class ACE_Concurrency_Strategy<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH> >;
template class ACE_Concurrency_Strategy<ACE_Thr_Server_Logging_Handler>;
-template class ACE_Creation_Strategy<ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH> >;
+template class ACE_Creation_Strategy<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH> >;
template class ACE_Creation_Strategy<ACE_Thr_Server_Logging_Handler>;
template class ACE_Schedule_All_Reactive_Strategy<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH> >;
template class ACE_Schedule_All_Threaded_Strategy<ACE_Thr_Server_Logging_Handler>;
-template class ACE_Scheduling_Strategy<ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH> >;
+template class ACE_Scheduling_Strategy<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH> >;
template class ACE_Scheduling_Strategy<ACE_Thr_Server_Logging_Handler>;
-template class ACE_Server_Logging_Handler<ACE_TLI_STREAM, unsigned long, ACE_NULL_SYNCH>;
+template class ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH>;
template class ACE_Strategy_Acceptor<ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, u_long, ACE_NULL_SYNCH>, LOGGING_PEER_ACCEPTOR>;
template class ACE_Strategy_Acceptor<ACE_Thr_Server_Logging_Handler, LOGGING_PEER_ACCEPTOR>;
-template class ACE_Svc_Handler<ACE_TLI_STREAM, ACE_SYNCH>;
+template class ACE_Svc_Handler<LOGGING_PEER_STREAM, ACE_SYNCH>;
#if defined (ACE_HAS_THREADS)
-template class ACE_Svc_Handler<ACE_TLI_STREAM, ACE_NULL_SYNCH>;
-template class ACE_Server_Logging_Handler<ACE_TLI_STREAM, ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long>, ACE_MT_SYNCH>;
+template class ACE_Svc_Handler<LOGGING_PEER_STREAM, ACE_NULL_SYNCH>;
+template class ACE_Server_Logging_Handler<LOGGING_PEER_STREAM, ACE_Atomic_Op<ACE_Thread_Mutex, u_long>, ACE_MT_SYNCH>;
#endif /* ACE_HAS_THREADS */
#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */