diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-31 15:04:34 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-31 15:04:34 +0000 |
commit | fddf6605c3d1a6bc487e4376ca76c76c58ccc16f (patch) | |
tree | 09e13834c7000f4cfae4afe5b515b5317f8e66ab | |
parent | 290ffdddb7b4d9de644955a46c8b8d53b142e1a7 (diff) | |
download | ATCD-fddf6605c3d1a6bc487e4376ca76c76c58ccc16f.tar.gz |
ChangeLogTag:Wed Mar 31 09:02:39 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLog-99c | 11 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 87 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.h | 20 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.i | 12 |
4 files changed, 93 insertions, 37 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 803b1675843..76fac3483d2 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,14 @@ +Wed Mar 31 09:02:39 1999 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/ORB_Core.h: + * tao/ORB_Core.i: + * tao/ORB_Core.cpp: + Moved the output CDR allocators from the ORB_Core into the + resource factory. Even though this resources can always be TSS + the ORB_Core is not used is a single thread anymore. + Changes similar to this may be required as the ORB-thread + relationship is decoupled. + Wed Mar 31 06:58:28 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * tao/ORB.cpp (multicast_to_service): Fixed a couple mistakes in diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 5f01c3d6bf6..293bbdb4d49 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -58,8 +58,6 @@ TAO_ORB_Core::TAO_ORB_Core (void) arl_same_port_connect_ (0), #endif /* TAO_ARL_USES_SAME_CONNECTOR_PORT */ preconnections_ (0), - input_cdr_dblock_allocator_ (0), - input_cdr_buffer_allocator_ (0), default_environment_ (0), tss_environment_ (this) { @@ -72,10 +70,6 @@ TAO_ORB_Core::~TAO_ORB_Core (void) // here once that chunk is actually implemented. if (preconnections_) ACE_OS::free (preconnections_); - - // Clean up memory pools - this->output_cdr_dblock_allocator_.remove (); - this->output_cdr_buffer_allocator_.remove (); } TAO_Default_Reactor::TAO_Default_Reactor (int nolock) @@ -555,11 +549,6 @@ TAO_ORB_Core::init (int &argc, char *argv[]) // @@ Init acceptor ... This needs altering for Pluggable Protocols! fredk this->acceptor (trf->get_acceptor ()); - this->input_cdr_dblock_allocator_ = - trf->input_cdr_dblock_allocator (); - this->input_cdr_buffer_allocator_ = - trf->input_cdr_buffer_allocator (); - TAO_Server_Strategy_Factory *ssf = this->server_factory (); if (ssf == 0) @@ -1120,6 +1109,18 @@ TAO_ORB_Core::input_cdr_buffer_allocator (void) #endif } +ACE_Allocator* +TAO_ORB_Core::output_cdr_dblock_allocator (void) +{ + return this->resource_factory ()->output_cdr_dblock_allocator (); +} + +ACE_Allocator* +TAO_ORB_Core::output_cdr_buffer_allocator (void) +{ + return this->resource_factory ()->output_cdr_buffer_allocator (); +} + // **************************************************************** @@ -1423,6 +1424,58 @@ TAO_Resource_Factory::input_cdr_buffer_allocator (void) return 0; } +ACE_Allocator* +TAO_Resource_Factory::output_cdr_dblock_allocator (void) +{ + switch (this->cdr_allocator_source_) + { + case TAO_GLOBAL: + if (GLOBAL_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_ == 0) + { + ACE_NEW_RETURN (GLOBAL_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_, + GBL_ALLOCATOR, + 0); + } + return GLOBAL_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_; + ACE_NOTREACHED (break); + case TAO_TSS: + if (TSS_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_ == 0) + { + ACE_NEW_RETURN (TSS_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_, + TSS_ALLOCATOR, + 0); + } + return TSS_APP_ALLOCATED::instance ()->output_cdr_dblock_allocator_; + ACE_NOTREACHED (break); + } + return 0; +} + +ACE_Allocator * +TAO_Resource_Factory::output_cdr_buffer_allocator (void) +{ + switch (this->cdr_allocator_source_) + { + case TAO_GLOBAL: + if (GLOBAL_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_ == 0) + { + ACE_NEW_RETURN (GLOBAL_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_, + GBL_ALLOCATOR, + 0); + } + return GLOBAL_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_; + case TAO_TSS: + if (TSS_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_ == 0) + { + ACE_NEW_RETURN (TSS_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_, + TSS_ALLOCATOR, + 0); + } + return TSS_APP_ALLOCATED::instance ()->output_cdr_buffer_allocator_; + } + return 0; +} + ACE_Data_Block* TAO_Resource_Factory::create_input_cdr_data_block (size_t size) @@ -1503,7 +1556,9 @@ TAO_Resource_Factory::App_Allocated::App_Allocated (void) poa_(0), alloc_(0), input_cdr_dblock_allocator_ (0), - input_cdr_buffer_allocator_ (0) + input_cdr_buffer_allocator_ (0), + output_cdr_dblock_allocator_ (0), + output_cdr_buffer_allocator_ (0) { } @@ -1516,6 +1571,14 @@ TAO_Resource_Factory::App_Allocated::~App_Allocated (void) if (this->input_cdr_buffer_allocator_ != 0) this->input_cdr_buffer_allocator_->remove (); delete this->input_cdr_buffer_allocator_; + + if (this->output_cdr_dblock_allocator_ != 0) + this->output_cdr_dblock_allocator_->remove (); + delete this->output_cdr_dblock_allocator_; + + if (this->output_cdr_buffer_allocator_ != 0) + this->output_cdr_buffer_allocator_->remove (); + delete this->output_cdr_buffer_allocator_; } TAO_Resource_Factory::Pre_Allocated::~Pre_Allocated (void) diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 69cdcb89c40..eb17d4f3a92 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -405,19 +405,6 @@ protected: // A string of comma-separated <{host}>:<{port}> pairs used to // pre-establish connections using <preconnect>. - typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL,ACE_Null_Mutex> TSS_MALLOC; - typedef ACE_Allocator_Adapter<TSS_MALLOC> TSS_ALLOCATOR; - - TSS_ALLOCATOR output_cdr_dblock_allocator_; - // The Allocator for the ACE_Data_Blocks used in the input CDRs. - - TSS_ALLOCATOR output_cdr_buffer_allocator_; - // The Allocator for the input CDR buffers - - ACE_Allocator *input_cdr_dblock_allocator_; - ACE_Allocator *input_cdr_buffer_allocator_; - // Cache the resource factory allocators. - CORBA_Environment* default_environment_; // The default environment for the thread. @@ -571,6 +558,10 @@ public: virtual ACE_Allocator* input_cdr_buffer_allocator (void); // Access the input CDR allocators. + virtual ACE_Allocator* output_cdr_dblock_allocator (void); + virtual ACE_Allocator* output_cdr_buffer_allocator (void); + // Access the output CDR allocators. + ACE_Data_Block *create_input_cdr_data_block (size_t size); // The Message Blocks used for input CDRs must have appropiate // locking strategies. @@ -659,6 +650,9 @@ public: ACE_Allocator *input_cdr_buffer_allocator_; // The allocators for the input CDR streams. + ACE_Allocator *output_cdr_dblock_allocator_; + ACE_Allocator *output_cdr_buffer_allocator_; + // The allocators for the output CDR streams. }; protected: diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 3bda3cf324b..9b8515265f9 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -144,18 +144,6 @@ TAO_ORB_Core::using_collocation (CORBA::Boolean use_col) return retv; } -ACE_INLINE ACE_Allocator* -TAO_ORB_Core::output_cdr_dblock_allocator (void) -{ - return &this->output_cdr_dblock_allocator_; -} - -ACE_INLINE ACE_Allocator* -TAO_ORB_Core::output_cdr_buffer_allocator (void) -{ - return &this->output_cdr_buffer_allocator_; -} - ACE_INLINE CORBA_Environment* TAO_ORB_Core::default_environment (void) const { |