From 4cb93b09f13a4ad3da30b2c5c859c7c3896b38bc Mon Sep 17 00:00:00 2001 From: irfan Date: Mon, 1 Jun 1998 18:03:22 +0000 Subject: *** empty log message *** --- ChangeLog-98b | 6 ++++++ ace/Timeprobe.cpp | 13 +++---------- ace/Timeprobe.h | 11 +++-------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/ChangeLog-98b b/ChangeLog-98b index 5e9ff9566a4..c4cb741a19e 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,9 @@ +Mon Jun 01 13:01:14 1998 Irfan Pyarali + + * ace/Timeprobe: The vxworks compiler is lame as it cannot handle + operator placement new for arrays. Therefore, ACE_Allocator was + removed in favor of regular new and delete. + Mon Jun 01 09:54:51 1998 David L. Levine * tests/Timeprobe_Test.cpp: removed trailing ; from template diff --git a/ace/Timeprobe.cpp b/ace/Timeprobe.cpp index e629109343b..8ce9286ac0c 100644 --- a/ace/Timeprobe.cpp +++ b/ace/Timeprobe.cpp @@ -14,17 +14,13 @@ #include "ace/High_Res_Timer.h" template -ACE_Timeprobe::ACE_Timeprobe (u_long size, - ACE_Allocator *alloc) +ACE_Timeprobe::ACE_Timeprobe (u_long size) : timeprobes_ (0), - allocator_ (alloc != 0 ? alloc : ACE_Allocator::instance ()), lock_ (), max_size_ (size), current_size_ (0) { - ACE_NEW_MALLOC (this->timeprobes_, - (ACE_timeprobe_t *) this->allocator_->malloc ((sizeof (ACE_timeprobe_t)) * this->max_size_), - ACE_timeprobe_t[this->max_size_]); + this->timeprobes_ = new ACE_timeprobe_t[this->max_size_]; #ifdef VXWORKS if (sysProcNumGet () == 0) @@ -41,10 +37,7 @@ ACE_Timeprobe::ACE_Timeprobe (u_long size, template ACE_Timeprobe::~ACE_Timeprobe (void) { - for (u_long i = 0; i < this->max_size_; i++) - this->timeprobes_[i].ACE_timeprobe_t::~ACE_timeprobe_t (); - - this->allocator_->free (this->timeprobes_); + delete this->timeprobes_; } template void diff --git a/ace/Timeprobe.h b/ace/Timeprobe.h index 61476dc74af..e29d0af56f8 100644 --- a/ace/Timeprobe.h +++ b/ace/Timeprobe.h @@ -6,7 +6,7 @@ // This class is compiled only when ACE_COMPILE_TIMEPROBES is defined #if defined (ACE_COMPILE_TIMEPROBES) -#include "ace/Malloc.h" +#include "ace/Containers.h" // = Event Descriptions struct ACE_Event_Descriptions @@ -99,10 +99,8 @@ public: // Default size of the slots in Timeprobe }; - ACE_Timeprobe (u_long size = ACE_DEFAULT_TABLE_SIZE, - ACE_Allocator *alloc = 0); - // Create Timeprobes with slots, using for the - // allocator. + ACE_Timeprobe (u_long size = ACE_DEFAULT_TABLE_SIZE); + // Create Timeprobes with slots ~ACE_Timeprobe (void); // Destructor @@ -153,9 +151,6 @@ protected: ACE_timeprobe_t *timeprobes_; // Time probe slots - ACE_Allocator *allocator_; - // Pointer to a memory allocator. - ACE_LOCK lock_; // Synchronization variable. -- cgit v1.2.1