diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-20 02:02:28 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-20 02:02:28 +0000 |
commit | bf4f90b6f2adde58d026db05a1fed406b26c5acb (patch) | |
tree | 7db0c98880dde2b267a696ec10b77ad6355e38bf | |
parent | cc120c436796c87dc8f5ff4ab8e5d2e8b81ffaf3 (diff) | |
download | ATCD-bf4f90b6f2adde58d026db05a1fed406b26c5acb.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 27 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h | 6 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp | 6 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp | 32 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 27 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h | 6 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/client.cpp | 6 | ||||
-rw-r--r-- | TAO/tests/Cubit/TAO/MT_Cubit/server.cpp | 32 |
8 files changed, 94 insertions, 48 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index afb6e2776cc..6be857252fc 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -166,6 +166,7 @@ Task_State::parse_args (int argc,char **argv) iors_[i] = ACE_OS::strdup (buf); i++; } + this->iors_count_ = i; ACE_OS::fclose (ior_file); } @@ -214,6 +215,26 @@ Task_State::parse_args (int argc,char **argv) } +Task_State::~Task_State (void) +{ + int i; + + if (this->ior_file_ != 0) + delete this->ior_file_; + + // Delete the strduped memory + for (i=0;i<this->iors_count_; i++) + ACE_OS::free (this->iors_ [i]); + + // Delete the barrier + + delete this->barrier_; + delete this->semaphore_; + delete [] this->latency_; + delete [] this->global_jitter_array_; + delete [] this->count_; +} + Client::Client (ACE_Thread_Manager *thread_manager, Task_State *ts, u_int id) : ACE_MT (ACE_Task<ACE_MT_SYNCH> (thread_manager)), ts_ (ts), @@ -675,6 +696,10 @@ Client::svc (void) } } + // Delete dynamic memory + + CORBA::release (cb); + return 0; } @@ -1127,6 +1152,8 @@ Client::run_tests (Cubit_ptr cb, error_count)); } + // Delete the dynamically allocated memory + delete [] my_jitter_array; return 0; } diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h index fb8a347a8f9..d7428d85633 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h @@ -109,6 +109,9 @@ public: // Constructor. Takes the command line arguments, which are later // passed into ORB_init. + ~Task_State (void); + // Destructor + CORBA::String key_; // All cubit objects will have this as prefix to its key. @@ -168,6 +171,9 @@ public: // Array of pointers used to hold the ior strings read from the ior file // that the server created. + int iors_count_; + // count on the number of iors + char *ior_file_; // Name of the filename that the server used to store the iors. diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp index fa42dfbe3f4..e96e2d65313 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp @@ -589,6 +589,12 @@ do_priority_inversion_test (ACE_Thread_Manager *thread_manager, #if defined (VXWORKS) delete task_id; #endif /* VXWORKS */ + + // Delete the low priority task array + for (i = number_of_low_priority_client; i > 0; i--) + delete low_priority_client [i - 1]; + + delete[] low_priority_client; return 0; } diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp index 8ff520cf4fc..4dc037c4020 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.cpp @@ -452,30 +452,14 @@ int Server::start_servants (ACE_Thread_Manager *serv_thr_mgr, Task_State *ts) { - ACE_ARGV tmp_args (this->argv_); - char *low_thread_args; - const char *arg_buf = tmp_args.buf (); - int arg_len = ACE_OS::strlen (arg_buf); - - ACE_NEW_RETURN (low_thread_args, - char[arg_len + 1], - -1); - - ACE_OS::strcpy (low_thread_args, - arg_buf); - char *args1; - - // @@ Naga, can you please explain why you need to do all of this? - // i.e, we need some comments here! In particular, what is args1 - // being used for and how will we know that ACE_DEFAULT_ARGV_BUFSIZ - // is an appropriate size? It seems to me that we should either (1) - // add an accessor on ACE_ARGV to determine what this size ought to - // be or (2) we should try to use/add a method on ACE_ARGV that - // converts the argv back into a char * buffer or something! At any - // rate, this code should be cleaned up and abstracted better. - ACE_NEW_RETURN (args1, - char[ACE_DEFAULT_ARGV_BUFSIZ], - -1); + //DONE// @@ Naga, can you please explain why you need to do all of this? + //DONE// i.e, we need some comments here! In particular, what is args1 + //DONE// being used for and how will we know that ACE_DEFAULT_ARGV_BUFSIZ + //DONE// is an appropriate size? It seems to me that we should either (1) + //DONE// add an accessor on ACE_ARGV to determine what this size ought to + //DONE// be or (2) we should try to use/add a method on ACE_ARGV that + //DONE// converts the argv back into a char * buffer or something! At any + //DONE// rate, this code should be cleaned up and abstracted better. int i; for (i = 0; i < this->argc_ ; i++) diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index afb6e2776cc..6be857252fc 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -166,6 +166,7 @@ Task_State::parse_args (int argc,char **argv) iors_[i] = ACE_OS::strdup (buf); i++; } + this->iors_count_ = i; ACE_OS::fclose (ior_file); } @@ -214,6 +215,26 @@ Task_State::parse_args (int argc,char **argv) } +Task_State::~Task_State (void) +{ + int i; + + if (this->ior_file_ != 0) + delete this->ior_file_; + + // Delete the strduped memory + for (i=0;i<this->iors_count_; i++) + ACE_OS::free (this->iors_ [i]); + + // Delete the barrier + + delete this->barrier_; + delete this->semaphore_; + delete [] this->latency_; + delete [] this->global_jitter_array_; + delete [] this->count_; +} + Client::Client (ACE_Thread_Manager *thread_manager, Task_State *ts, u_int id) : ACE_MT (ACE_Task<ACE_MT_SYNCH> (thread_manager)), ts_ (ts), @@ -675,6 +696,10 @@ Client::svc (void) } } + // Delete dynamic memory + + CORBA::release (cb); + return 0; } @@ -1127,6 +1152,8 @@ Client::run_tests (Cubit_ptr cb, error_count)); } + // Delete the dynamically allocated memory + delete [] my_jitter_array; return 0; } diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h index fb8a347a8f9..d7428d85633 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h +++ b/TAO/tests/Cubit/TAO/MT_Cubit/Task_Client.h @@ -109,6 +109,9 @@ public: // Constructor. Takes the command line arguments, which are later // passed into ORB_init. + ~Task_State (void); + // Destructor + CORBA::String key_; // All cubit objects will have this as prefix to its key. @@ -168,6 +171,9 @@ public: // Array of pointers used to hold the ior strings read from the ior file // that the server created. + int iors_count_; + // count on the number of iors + char *ior_file_; // Name of the filename that the server used to store the iors. diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp index fa42dfbe3f4..e96e2d65313 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/client.cpp @@ -589,6 +589,12 @@ do_priority_inversion_test (ACE_Thread_Manager *thread_manager, #if defined (VXWORKS) delete task_id; #endif /* VXWORKS */ + + // Delete the low priority task array + for (i = number_of_low_priority_client; i > 0; i--) + delete low_priority_client [i - 1]; + + delete[] low_priority_client; return 0; } diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp index 8ff520cf4fc..4dc037c4020 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/server.cpp @@ -452,30 +452,14 @@ int Server::start_servants (ACE_Thread_Manager *serv_thr_mgr, Task_State *ts) { - ACE_ARGV tmp_args (this->argv_); - char *low_thread_args; - const char *arg_buf = tmp_args.buf (); - int arg_len = ACE_OS::strlen (arg_buf); - - ACE_NEW_RETURN (low_thread_args, - char[arg_len + 1], - -1); - - ACE_OS::strcpy (low_thread_args, - arg_buf); - char *args1; - - // @@ Naga, can you please explain why you need to do all of this? - // i.e, we need some comments here! In particular, what is args1 - // being used for and how will we know that ACE_DEFAULT_ARGV_BUFSIZ - // is an appropriate size? It seems to me that we should either (1) - // add an accessor on ACE_ARGV to determine what this size ought to - // be or (2) we should try to use/add a method on ACE_ARGV that - // converts the argv back into a char * buffer or something! At any - // rate, this code should be cleaned up and abstracted better. - ACE_NEW_RETURN (args1, - char[ACE_DEFAULT_ARGV_BUFSIZ], - -1); + //DONE// @@ Naga, can you please explain why you need to do all of this? + //DONE// i.e, we need some comments here! In particular, what is args1 + //DONE// being used for and how will we know that ACE_DEFAULT_ARGV_BUFSIZ + //DONE// is an appropriate size? It seems to me that we should either (1) + //DONE// add an accessor on ACE_ARGV to determine what this size ought to + //DONE// be or (2) we should try to use/add a method on ACE_ARGV that + //DONE// converts the argv back into a char * buffer or something! At any + //DONE// rate, this code should be cleaned up and abstracted better. int i; for (i = 0; i < this->argc_ ; i++) |