diff options
author | Adam Mitz <mitza@ociweb.com> | 2015-11-06 17:07:11 -0600 |
---|---|---|
committer | Adam Mitz <mitza@ociweb.com> | 2015-11-06 17:07:11 -0600 |
commit | ac5e1702c9f9bee9f1f7bfce8c1a6f3847ea6b4b (patch) | |
tree | 0e70d1f51c39e688a05a6cdc2af58408222e4a0d /ACE/ace/Arg_Shifter.cpp | |
parent | 5272b5b81f92c298cb998b5bb0b0dbca3e7f29fe (diff) | |
download | ATCD-ac5e1702c9f9bee9f1f7bfce8c1a6f3847ea6b4b.tar.gz |
Merged branch ace-face-safety (FACE Safety Profile import from OCITAO).
Diffstat (limited to 'ACE/ace/Arg_Shifter.cpp')
-rw-r--r-- | ACE/ace/Arg_Shifter.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ACE/ace/Arg_Shifter.cpp b/ACE/ace/Arg_Shifter.cpp index 89658a8b830..b7f1e1d5001 100644 --- a/ACE/ace/Arg_Shifter.cpp +++ b/ACE/ace/Arg_Shifter.cpp @@ -6,6 +6,9 @@ #include "ace/OS_NS_strings.h" #include "ace/OS_Errno.h" #include "ace/OS_Memory.h" +#if defined (ACE_HAS_ALLOC_HOOKS) +# include "ace/Malloc_Base.h" +#endif /* ACE_HAS_ALLOC_HOOKS */ ACE_BEGIN_VERSIONED_NAMESPACE_DECL @@ -45,9 +48,13 @@ ACE_Arg_Shifter_T<CHAR_TYPE>::init (void) { // If not provided with one, allocate a temporary array. if (this->temp_ == 0) +#if defined (ACE_HAS_ALLOC_HOOKS) + this->temp_ = reinterpret_cast<const CHAR_TYPE **> + (ACE_Allocator::instance ()->malloc (sizeof (CHAR_TYPE*) * this->total_size_)); +#else ACE_NEW (this->temp_, const CHAR_TYPE *[this->total_size_]); - +#endif /* ACE_HAS_ALLOC_HOOKS */ if (this->temp_ != 0) { // Fill the temporary array. @@ -70,7 +77,12 @@ template <typename CHAR_TYPE> ACE_Arg_Shifter_T<CHAR_TYPE>::~ACE_Arg_Shifter_T (void) { // Delete the temporary vector. +#if defined (ACE_HAS_ALLOC_HOOKS) + if (this->temp_) + ACE_Allocator::instance ()->free (this->temp_); +#else delete [] temp_; +#endif /* ACE_HAS_ALLOC_HOOKS */ } template <typename CHAR_TYPE> |