diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-20 17:55:19 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-20 17:55:19 +0000 |
commit | 78314e8a1363f906259ddabfd650e92809507f22 (patch) | |
tree | 991dde0b301931a406043a04e1c398d8492432c8 | |
parent | ec4aa4c0f3d30c990b18b0224857d9dfe2806309 (diff) | |
download | ATCD-78314e8a1363f906259ddabfd650e92809507f22.tar.gz |
ChangeLogTag:Wed May 20 12:10:12 1998 Carlos O'Ryan <coryan@JIG>
31 files changed, 739 insertions, 154 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 5142404514d..cb2380c497b 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,87 @@ +Wed May 20 12:10:12 1998 Carlos O'Ryan <coryan@JIG> + + * tao/CDR.h: + * tao/CDR.i: + * tao/CDR.cpp: + OutputCDR buffers grow by appending a message blocks using the + cont() field. + + * tao/GIOP.cpp: + When sending an OutputCDR use writev to send the message block + chain. + + * tao/decode.cpp: + Added support for no copy marshalling of octet sequences. + + * tao/decode.cpp: + * tao/encode.cpp: + Reverted part of a change by Andy because it simply breaks tons + of code. The change in question was passing the address of a + pointer to a string (or wstring) to the + marshlling/dermarshalling interpreter, but only when the string + was a field of a structure. + + * tao/orbconf.h: + * tao/params.h: + * tao/params.i: + * tao/params.cpp: + * tao/ORB_Core.cpp: + * docs/Options.html: + Added options to control the tradeoff between copy vs. no copy + marshalling of octet sequences. If the octet sequence is "small + enough" and the current CDR buffer contains enough space the + octet sequence is copied instead of chained with the buffer. + + * tao/Typecode.cpp: + More fixes to avoid crashes at shutdown. + + * tao/Any.cpp: + The start() method was changed to begin() it looks more STL + like. Also removed a bunch of casts that are no longer needed. + + * tao/Align.h: + Corrected a typo in a comment. + + * orbsvcs/tests/EC_Multiple/EC_Multiple.h: + Reduce the maximum number of suppliers, consumers and messages, + otherwise we exceed the maximum stack size on NT. + + * orbsvcs/Event_Service/Event_Service.cpp: + Fixed error message. + + * tests/CDR/CDR.dsw: + * tests/CDR/growth.dsw: + * tests/CDR/growth.dsp: + Added growth to the project file. + + * tests/CDR/growth.cpp: + Workaound MSVC++ bug wrt conversions from UINT64 to double. + + * tests/Cubit/TAO/IDL_Cubit/client.cpp: + Use larger sequences. + + * tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp: + Fixed ambiguous use of [] operator. + + * tests/Cubit/TAO/IDL_Cubit/client.dsp: + * tests/Cubit/TAO/IDL_Cubit/server.dsp: + For Win32 Debug we use aced.lib. + + * tests/Cubit/TAO/MT_Cubit/server.dsp: + Added orbsvcs.lib to the library list. The client will not + compile due to unportable use of getrusage. + + * tests/OctetSeq/OctetSeq.dsw: + * tests/OctetSeq/OctetSeq.dsp: + Added a project file for this test. + + * tests/OctetSeq/OctetSeq.cpp: + Fixed several portability problems. + The OutputCDR is not preallocated. + + * tests/Param_Test/tests.cpp: + Fixed bug in bounded string sequence test. + 1998-05-20 Torben Worm <tworm@cumbia.cs.wustl.edu> * orbsvcs/tests/Concurrency/CC_client.cpp diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index 57efeb88fff..80881cc4925 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -109,6 +109,13 @@ If not specified, the system-dependent default is used.</TD></TR> be established, a warning is announced and it continues with the next listed. Listing the same combination multiple times will properly establish multiple connections to that endpoint.</TD></TR> +<TR> +<TD><CODE>-ORBCDRtradeoff</CODE> <EM>maxsize</EM></TD> +<TD><A name="-ORBCDRtradeoff"></a>Control the strategy to tradeoff +between copy vs no copy marshalling of octet sequences. +If an octet sequence is smaller than <EM>maxsize</EM> and the current +message block contains enough space for it the octet sequence is +copied instead of appended to the CDR stream.</TD></TR> </TABLE> </P> </blockquote> diff --git a/TAO/orbsvcs/Event_Service/Event_Service.cpp b/TAO/orbsvcs/Event_Service/Event_Service.cpp index 0c64e4e8399..c7827794ca5 100644 --- a/TAO/orbsvcs/Event_Service/Event_Service.cpp +++ b/TAO/orbsvcs/Event_Service/Event_Service.cpp @@ -71,7 +71,7 @@ int main (int argc, char *argv[]) orb->resolve_initial_references ("NameService"); if (CORBA::is_nil (naming_obj.in ())) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), + " (%P|%t) Unable to initialize the Naming Service.\n"), 1); CosNaming::NamingContext_var naming_context = diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h index eddfd15a913..809f0e7e954 100644 --- a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h +++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h @@ -154,13 +154,13 @@ public: Test_ECG (void); enum { - MAX_EVENTS = 2048, + MAX_EVENTS = 1024, // Maximum number of events to send... - MAX_CONSUMERS = 32, + MAX_CONSUMERS = 16, // Maximum number of consumers. - MAX_SUPPLIERS = 32 + MAX_SUPPLIERS = 16 // Maximum number of suppliers. }; diff --git a/TAO/tao/Align.h b/TAO/tao/Align.h index eb6d3fbbb6e..34be66cf384 100644 --- a/TAO/tao/Align.h +++ b/TAO/tao/Align.h @@ -53,7 +53,7 @@ typedef u_long long ptr_arith_t; // // alignment - 1 = 0...001...1 = T1 // -// so the completent is: +// so the complement is: // // ~(alignment - 1) = 1...110...0 = T2 // diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index d229d16d591..7da728064b3 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -98,7 +98,7 @@ CORBA_Any::CORBA_Any (CORBA::TypeCode_ptr tc, stream.encode (this->type_, this->value_, 0, env); // retrieve the start of the message block chain and save it - this->cdr_ = stream.start ()->clone (); + this->cdr_ = stream.begin ()->clone (); } } } @@ -121,8 +121,7 @@ CORBA_Any::CORBA_Any (const CORBA_Any &src) { // the data was already encoded in "src". We simply duplicate it to avoid // copies. - this->cdr_ = ACE_Message_Block::duplicate ((ACE_Message_Block *) - src.cdr_); + this->cdr_ = ACE_Message_Block::duplicate (src.cdr_); } else { @@ -131,7 +130,7 @@ CORBA_Any::CORBA_Any (const CORBA_Any &src) stream.encode (this->type_, src.value_, 0, env); // retrieve the start of the message block chain and duplicate it - this->cdr_ = stream.start ()->clone (); + this->cdr_ = stream.begin ()->clone (); } } @@ -174,8 +173,7 @@ CORBA_Any::operator= (const CORBA_Any &src) // form and must be encoded. Else we must simply duplicate the message block if (src.any_owns_data_) { - this->cdr_ = ACE_Message_Block::duplicate ((ACE_Message_Block *) - src.cdr_); + this->cdr_ = ACE_Message_Block::duplicate (src.cdr_); } else { @@ -183,7 +181,7 @@ CORBA_Any::operator= (const CORBA_Any &src) stream.encode (this->type_, src.value_, 0, env); // retrieve the start of the message block chain and duplicate it - this->cdr_ = stream.start ()->clone (); + this->cdr_ = stream.begin ()->clone (); } return *this; } @@ -262,8 +260,7 @@ CORBA_Any::replace (CORBA::TypeCode_ptr tc, stream.encode (tc, value, 0, env); // retrieve the start of the message block chain and duplicate it - this->cdr_ = ACE_Message_Block::duplicate ((ACE_Message_Block *) - stream.start ()); + this->cdr_ = ACE_Message_Block::duplicate (stream.begin ()); } } diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp index 9d682b195e9..c9436c9583a 100644 --- a/TAO/tao/CDR.cpp +++ b/TAO/tao/CDR.cpp @@ -30,11 +30,7 @@ // though.) // // THREADING NOTE: "CDR" is a data structure which must be protected -// by external critical sections. Like simpler numeric types, "CDR" -// instances are accessed and modified atomically. This -// implementation is reentrant, so that independent "CDR" values may -// be manipulated concurrently when the underlying programming -// environment is itself reentrant. +// by external critical sections. #include "tao/corba.h" @@ -156,6 +152,7 @@ TAO_OutputCDR::TAO_OutputCDR (size_t size, } ACE_NEW (this->start_, ACE_Message_Block (size)); CDR::mb_align (this->start_); + this->current_ = this->start_; } TAO_OutputCDR::TAO_OutputCDR (char *data, size_t size, @@ -168,6 +165,7 @@ TAO_OutputCDR::TAO_OutputCDR (char *data, size_t size, ACE_NEW (this->start_, ACE_Message_Block (data, size)); // We cannot trust the buffer to be properly aligned CDR::mb_align (this->start_); + this->current_ = this->start_; } TAO_OutputCDR::TAO_OutputCDR (ACE_Message_Block *data, @@ -180,50 +178,88 @@ TAO_OutputCDR::TAO_OutputCDR (ACE_Message_Block *data, this->start_ = ACE_Message_Block::duplicate (data); // We cannot trust the buffer to be properly aligned CDR::mb_align (this->start_); + this->current_ = this->start_; } TAO_OutputCDR::~TAO_OutputCDR (void) { ACE_Message_Block::release (this->start_); this->start_ = 0; + this->current_ = 0; } void TAO_OutputCDR::reset (void) { + this->current_ = this->start_; CDR::mb_align (this->start_); } -ACE_INLINE char* -TAO_OutputCDR::wr_ptr (void) const +size_t +TAO_OutputCDR::total_length (void) const { - return this->start_->wr_ptr (); + size_t l = 0; + // Compute the total size. + for (ACE_Message_Block *i = this->begin (); + i != this->end (); + i = i->cont ()) + l += i->length (); + return l; } -ACE_INLINE char* -TAO_OutputCDR::end (void) const -{ - return this->start_->end (); -} ACE_INLINE int TAO_OutputCDR::adjust (size_t size, size_t align, char*& buf) { - buf = ptr_align_binary (this->wr_ptr(), align); + buf = ptr_align_binary (this->current_->wr_ptr(), align); char *end = buf + size; - if (end <= this->end ()) + if (end <= this->current_->end ()) { - this->start_->wr_ptr (end); + this->current_->wr_ptr (end); return 0; } - else if (CDR::grow (this->start_, - this->start_->size() + (end - this->end () )) == 0) + else { - // grow(0) may change the value of wr_ptr() so we have to + if (this->current_->cont () == 0 + || this->current_->size () < size + CDR::MAX_ALIGNMENT) + { + // Allocate the next block, it must be large enough. + int block_size = CDR::DEFAULT_BUFSIZE; + while (block_size < size + CDR::MAX_ALIGNMENT) + { + if (block_size < CDR::EXP_GROWTH_MAX) + block_size *= 2; + else + block_size += CDR::LINEAR_GROWTH_CHUNK; + } + this->good_bit_ = 0; + ACE_Message_Block* tmp; + ACE_NEW_RETURN (tmp, ACE_Message_Block (block_size), -1); + this->good_bit_ = 1; + + // The new block must start with the same alignment as the + // previous block finished. + ptr_arith_t tmpalign = + ptr_arith_t(tmp->wr_ptr ()) % CDR::MAX_ALIGNMENT; + ptr_arith_t curalign = + ptr_arith_t(this->current_->wr_ptr ()) % CDR::MAX_ALIGNMENT; + int offset = curalign - tmpalign; + if (offset < 0) + offset += CDR::MAX_ALIGNMENT; + tmp->rd_ptr (offset); + tmp->wr_ptr (tmp->rd_ptr ()); + + // grow the chain and set the current block. + tmp->cont (this->current_->cont ()); + this->current_->cont (tmp); + } + this->current_ = this->current_->cont (); + + // Now we are ready to set buf.. // recompute the position.... - buf = ptr_align_binary (this->wr_ptr(), align); - this->start_->wr_ptr (buf + size); + buf = ptr_align_binary (this->current_->wr_ptr(), align); + this->current_->wr_ptr (buf + size); return 0; } this->good_bit_ = 0; @@ -239,10 +275,10 @@ TAO_OutputCDR::adjust (size_t size, char*& buf) CORBA_Boolean TAO_OutputCDR::write_1 (const CORBA::Octet* x) { - if (this->wr_ptr () < this->end() || CDR::grow(this->start_, 0) == 0) + char* buf; + if (this->adjust (1, buf) == 0) { - *ACE_reinterpret_cast(CORBA::Octet*,this->wr_ptr()) = *x; - this->start_->wr_ptr (1); + *ACE_reinterpret_cast(CORBA::Octet*, buf) = *x; return CORBA::B_TRUE; } @@ -355,8 +391,8 @@ TAO_OutputCDR::write_array (const void* x, size_t align, CORBA::ULong length) { - char* buf; - if (this->adjust (size * length, align, buf) == 0) + char* buf; + if (this->adjust (size * length, align, buf) == 0) { #if !defined (TAO_ENABLE_SWAP_ON_WRITE) ACE_OS::memcpy (buf, x, size*length); @@ -451,6 +487,43 @@ TAO_OutputCDR::write_wstring (const CORBA::WChar *x) } CORBA_Boolean +TAO_OutputCDR::write_octet_array (const CORBA::Octet* x, + CORBA::ULong length) +{ +#if !defined (TAO_NO_COPY_OCTET_SEQUENCES) + return this->write_array (x, + CDR::OCTET_SIZE, + CDR::OCTET_ALIGN, + length); +#else + // @@ If the buffer is small and it fits in the current message + // block it may be cheaper just to copy the buffer. + int memcpy_tradeoff = + TAO_ORB_Core_instance ()->orb_params ()->cdr_memcpy_tradeoff (); + if (length < memcpy_tradeoff + && this->current_->wr_ptr () + length < this->current_->end ()) + return this->write_array (x, + CDR::OCTET_SIZE, + CDR::OCTET_ALIGN, + length); + + ACE_Message_Block* mb; + this->good_bit_ = 0; + ACE_NEW_RETURN (mb, + ACE_Message_Block (ACE_reinterpret_cast(char*,x), + length), + CORBA::B_FALSE); + mb->wr_ptr (length); + this->good_bit_ = 1; + + mb->cont (this->current_->cont ()); + this->current_->cont (mb); + this->current_ = mb; + return CORBA::B_TRUE; +#endif /* TAO_NO_COPY_OCTET_SEQUENCES */ +} + +CORBA_Boolean TAO_OutputCDR::write_boolean_array (const CORBA::Boolean* x, CORBA::ULong length) { @@ -561,11 +634,18 @@ TAO_InputCDR::operator= (const TAO_InputCDR& rhs) } TAO_InputCDR::TAO_InputCDR (const TAO_OutputCDR& rhs) - : start_ (ACE_Message_Block::duplicate (rhs.start_)), - factory_ (rhs.factory_), + : factory_ (rhs.factory_), do_byte_swap_ (rhs.do_byte_swap_), good_bit_ (1) { + size_t size = rhs.total_length (); + ACE_NEW (this->start_, + ACE_Message_Block (size + CDR::MAX_ALIGNMENT)); + CDR::mb_align (this->start_); + for (ACE_Message_Block *i = rhs.begin (); + i != rhs.end (); + i = i->cont ()) + this->start_->copy (i->rd_ptr (), i->length ()); } TAO_InputCDR::~TAO_InputCDR (void) diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index fdef84720a3..ffca4243b03 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -80,17 +80,17 @@ public: // Maximal CDR 1.1 alignment: "quad precision" FP (i.e. "long // double", size as above). - DEFAULT_BUFSIZE = 512, + DEFAULT_BUFSIZE = TAO_DEFAULT_CDR_BUFSIZE, // The default buffer size. // @@ TODO We want to add options to the ORB to control this // default value, so this constant should be read as the, default // default value ;-) - EXP_GROWTH_MAX = 4096, + EXP_GROWTH_MAX = TAO_DEFAULT_CDR_EXP_GROWTH_MAX, // The buffer size grows exponentially until it reaches this size; // afterwards it grows linearly using the next constant - LINEAR_GROWTH_CHUNK = 4096 + LINEAR_GROWTH_CHUNK = TAO_DEFAULT_CDR_LINEAR_GROWTH_CHUNK // Once exponential growth is ruled out the buffer size increases // in chunks of this size, note that this constants have the same // value right now, but it does not need to be so. @@ -246,15 +246,22 @@ public: // Returns 0 if an error has ocurred, the only expected error is to // run out of memory. - const ACE_Message_Block* start (void) const; + ACE_Message_Block* begin (void) const; // Return the start of the message block chain for this CDR stream. - // NOTE: In the current implementation the chain has length 1, but - // we are planning to change that. + // NOTE: The complete CDR stream is represented by a chain of + // message blocks. + + ACE_Message_Block* end (void) const; + // Return the last message in the chain that is is use. const char* buffer (void) const; size_t length (void) const; // Return the start and size of the internal buffer. - // NOTE: In future implementations these methods may be removed. + // NOTE: This methods only return information about the first block + // in the chain. + + size_t total_length (void) const; + // Add the length of each message block in the chain. CORBA::TypeCode::traverse_status encode (CORBA::TypeCode_ptr tc, const void *data, @@ -268,10 +275,6 @@ private: TAO_OutputCDR& operator= (const TAO_OutputCDR& rhs); // disallow copying... - char* wr_ptr (void) const; - char* end (void) const; - // The write pointer and end of the current message block. - int adjust (size_t size, char*& buf); // Returns (in <buf>) the next position in the buffer aligned to // <size>, it advances the Message_Block wr_ptr past the data @@ -310,8 +313,10 @@ private: private: ACE_Message_Block* start_; - // The start of the chain of message blocks, even though in the - // current version the chain always has length 1. + // The start of the chain of message blocks. + + ACE_Message_Block* current_; + // The current block in the chain were we are writing. TAO_Marshal_Factory *factory_; // maintain a factory that can make specialized marshaling objects diff --git a/TAO/tao/CDR.i b/TAO/tao/CDR.i index 6d794e74441..4223a786691 100644 --- a/TAO/tao/CDR.i +++ b/TAO/tao/CDR.i @@ -123,16 +123,6 @@ TAO_OutputCDR::write_wchar_array (const CORBA::WChar* x, } ACE_INLINE CORBA_Boolean -TAO_OutputCDR::write_octet_array (const CORBA::Octet* x, - CORBA::ULong length) -{ - return this->write_array (x, - CDR::OCTET_SIZE, - CDR::OCTET_ALIGN, - length); -} - -ACE_INLINE CORBA_Boolean TAO_OutputCDR::write_short_array (const CORBA::Short* x, CORBA::ULong length) { @@ -228,12 +218,18 @@ TAO_OutputCDR::good_bit (void) const return this->good_bit_; } -ACE_INLINE const ACE_Message_Block* -TAO_OutputCDR::start (void) const +ACE_INLINE ACE_Message_Block* +TAO_OutputCDR::begin (void) const { return this->start_; } +ACE_INLINE ACE_Message_Block* +TAO_OutputCDR::end (void) const +{ + return this->current_->cont (); +} + ACE_INLINE const char* TAO_OutputCDR::buffer (void) const { diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index 9a73097d71f..ae042301984 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -82,6 +82,40 @@ TAO_GIOP::dump_msg (const char *label, } } +// @@ TODO: this is a good candidate for an ACE routine, even more, +// all the code to write a Message_Block chain could be encapsulated +// in ACE. +static ssize_t +writev_n (ACE_HANDLE h, iovec* iov, int iovcnt) +{ + ssize_t writelen = 0; + int s = 0; + while (s < iovcnt) + { + ssize_t n = ACE_OS::writev (h, iov + s, iovcnt - s); + + if (n == -1) + { + return n; + } + else + { + writelen += n; + while (n >= iov[s].iov_len && s < iovcnt) + { + n -= iov[s].iov_len; + s++; + } + if (n != 0) + { + iov[s].iov_base += (iov[s].iov_len - n); + iov[s].iov_len -= n; + } + } + } + return writelen; +} + CORBA::Boolean TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, TAO_OutputCDR &stream) @@ -89,7 +123,7 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, ACE_TIMEPROBE (" -> GIOP::send_request - start"); char *buf = (char *) stream.buffer (); - size_t buflen = stream.length (); + size_t buflen = stream.total_length (); // assert (buflen == (stream.length - stream.remaining)); @@ -103,81 +137,100 @@ TAO_GIOP::send_request (TAO_SVC_HANDLER *handler, // this particular environment and that isn't handled by the // networking infrastructure (e.g. IPSEC). - *(CORBA::Long *) (buf + 8) = - (CORBA::Long) (buflen - TAO_GIOP_HEADER_LEN); + CORBA::ULong bodylen = buflen - TAO_GIOP_HEADER_LEN; +#if !defined (TAO_ENABLE_SWAP_ON_WRITE) + *ACE_reinterpret_cast(CORBA::ULong*,buf + 8) = bodylen; +#else + if (!stream->do_byte_swap_) + { + *ACE_reinterpret_cast(CORBA::ULong*, buf + 8) = bodylen; + } + else + { + CDR::swap_4 (ACE_reinterpret_cast(char*,&bodylen), buf + 8); + } +#endif // Strictly speaking, should not need to loop here because the // socket never gets set to a nonblocking mode ... some Linux // versions seem to need it though. Leaving it costs little. +#if 0 TAO_GIOP::dump_msg ("send", ACE_reinterpret_cast (u_char *, buf), buflen); +#endif TAO_SOCK_Stream &peer = handler->peer (); - while (buflen > 0) + const int TAO_WRITEV_MAX = 16; + iovec iov[TAO_WRITEV_MAX]; + int iovcnt = 0; + for (ACE_Message_Block* i = stream.begin (); + i != stream.end (); + i = i->cont ()) { - if (buflen > stream.length ()) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) ?? writebuf, buflen %u > length %u\n", - buflen, stream.length ())); - ACE_TIMEPROBE (" -> GIOP::send_request - fail"); - return CORBA::B_FALSE; - } - - ssize_t writelen = peer.send_n (buf, buflen); - -#if defined (DEBUG) - // dmsg_filter (6, "wrote %d bytes to connection %d", - // writelen, connection); - dmsg_filter (6, "wrote %d bytes", writelen); -#endif /* DEBUG */ - - assert ((writelen >= 0 - && ((size_t)writelen) <= buflen) || writelen == -1); - - // On error or EOF, report the fault, close the connection, and - // mark it as unusable/defunct. - // - // @@ on client side write errors, we may hit the case that the - // server did a clean shutdown but we've not yet read the - // GIOP::CloseConnection message. If we get an error, we need - // to see if there is such a message waiting for us, and if so - // we should cause (full) rebinding to take place. - - if (writelen == -1) - { - ACE_DEBUG ((LM_ERROR, - "(%P|%t) %p\n", "OutgoingMessage::writebuf ()")); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) closing conn %d after fault\n", peer.get_handle ())); - handler->close (); - ACE_TIMEPROBE (" -> GIOP::send_request - fail"); - return CORBA::B_FALSE; - } - else if (writelen == 0) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) OutgoingMessage::writebuf () ... EOF, closing conn %d\n", - peer.get_handle ())); - handler->close (); - ACE_TIMEPROBE (" -> GIOP::send_request - fail"); - return CORBA::B_FALSE; - } - if ((buflen -= writelen) != 0) - buf += writelen; + iov[iovcnt].iov_base = i->rd_ptr (); + iov[iovcnt].iov_len = i->length (); + iovcnt++; + + // The buffer is full make a OS call. + // @@ TODO this should be optimized on a per-platform basis, for + // instance, some platforms do not implement writev() there we + // should copy the data into a buffer and call send_n(). In + // other cases there may be some limits on the size of the + // iovec, there we should set TAO_WRITEV_MAX to that limit. + if (iovcnt == TAO_WRITEV_MAX) + { + ssize_t n = writev_n (peer.get_handle (), iov, iovcnt); + if (n == -1) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) closing conn %d after fault %p\n", + peer.get_handle (), "GIOP::send_request")); + handler->close (); + ACE_TIMEPROBE (" -> GIOP::send_request - fail"); + return CORBA::B_FALSE; + } + else if (n == 0) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) GIOP::send_request (): " + "EOF, closing conn %d\n", + peer.get_handle ())); + handler->close (); + ACE_TIMEPROBE (" -> GIOP::send_request - fail"); + return CORBA::B_FALSE; + } + iovcnt = 0; + } + } -#if defined (DEBUG) - // - // NOTE: this should never be seen. However, on Linux - // it's been seen with UNIX domain sockets. - // - if (buflen) - dmsg_filter (8, "%u more bytes to write...\n", buflen); -#endif /* DEBUG */ + if (iovcnt != 0) + { + ssize_t n = writev_n (peer.get_handle (), iov, iovcnt); + if (n == -1) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) closing conn %d after fault %p\n", + peer.get_handle (), "GIOP::send_request")); + handler->close (); + ACE_TIMEPROBE (" -> GIOP::send_request - fail"); + return CORBA::B_FALSE; + } + else if (n == 0) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) GIOP::send_request (): " + "EOF, closing conn %d\n", + peer.get_handle ())); + handler->close (); + ACE_TIMEPROBE (" -> GIOP::send_request - fail"); + return CORBA::B_FALSE; + } + iovcnt = 0; } + ACE_TIMEPROBE (" -> GIOP::send_request - done"); return CORBA::B_TRUE; } @@ -266,7 +319,7 @@ TAO_GIOP::read_buffer (TAO_SOCK_Stream &peer, char *buf, size_t len) { - ssize_t bytes_read = bytes_read = peer.recv_n (buf, len); + ssize_t bytes_read = peer.recv_n (buf, len); if (bytes_read == -1 && errno == ECONNRESET) { diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index ab056a5f955..cf194f9f188 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -91,6 +91,7 @@ TAO_ORB_Core::init (int& argc, char** argv) CORBA::UShort port = defport; CORBA::Boolean use_ior = CORBA::B_TRUE; CORBA::Boolean opt_collocation = CORBA::B_TRUE; + int cdr_tradeoff = TAO_DEFAULT_CDR_MEMCPY_TRADEOFF; // The following things should be changed to use the ACE_Env_Value<> // template sometime. @@ -294,6 +295,15 @@ TAO_ORB_Core::init (int& argc, char** argv) arg_shifter.consume_arg (); } } + else if (ACE_OS::strcmp (current_arg, "-ORBCDRtradeoff") == 0) + { + arg_shifter.consume_arg (); + if (arg_shifter.is_parameter_next ()) + { + cdr_tradeoff = ACE_OS::atoi (arg_shifter.get_current ()); + arg_shifter.consume_arg (); + } + } else arg_shifter.ignore_arg (); } diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp index 45a44abcc1d..4f74b92065a 100644 --- a/TAO/tao/Typecode.cpp +++ b/TAO/tao/Typecode.cpp @@ -510,9 +510,10 @@ TC_Private_State::~TC_Private_State (void) for (CORBA::ULong i = 0; i < this->tc_member_count_; i++) - // free up the memory allocated for the typecode only if it has a parent + // free up the memory allocated for the typecode only if + // it has a parent if (this->tc_member_type_list_[i]->parent_) - delete this->tc_member_type_list_[i]; + CORBA::release (this->tc_member_type_list_[i]); // Now free up the array. delete [] this->tc_member_type_list_; @@ -557,7 +558,7 @@ TC_Private_State::~TC_Private_State (void) // free up the memory allocated for the typecode if it has a // parent that owns it if (this->tc_member_type_list_[i]->parent_) - delete this->tc_member_type_list_[i]; + CORBA::release (this->tc_member_type_list_[i]); // Now free up the array. delete [] this->tc_member_type_list_; @@ -575,9 +576,10 @@ TC_Private_State::~TC_Private_State (void) this->tc_member_label_list_ = 0; } this->tc_member_count_ = 0; + // Discriminator must come last b/c it will be inside the Any // in each element of the label list. - delete this->tc_discriminator_type_; + CORBA::release (this->tc_discriminator_type_); this->tc_discriminator_type_ = 0; } break; diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp index 372cb7db193..538bcdfc49c 100644 --- a/TAO/tao/decode.cpp +++ b/TAO/tao/decode.cpp @@ -761,8 +761,6 @@ TAO_Marshal_Struct::decode (CORBA::TypeCode_ptr tc, continue_decoding = stream->read_wchar (*(CORBA::WChar *) data); break; - case CORBA::tk_string: - case CORBA::tk_wstring: case CORBA::tk_TypeCode: case CORBA::tk_objref: retval = stream->decode (param, &data, 0, env); @@ -775,6 +773,8 @@ TAO_Marshal_Struct::decode (CORBA::TypeCode_ptr tc, case CORBA::tk_array: case CORBA::tk_alias: case CORBA::tk_except: + case CORBA::tk_string: + case CORBA::tk_wstring: retval = stream->decode (param, data, 0, env); break; default: diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp index 73994a7b816..376ea6e222b 100644 --- a/TAO/tao/encode.cpp +++ b/TAO/tao/encode.cpp @@ -444,10 +444,10 @@ TAO_Marshal_Struct::encode (CORBA::TypeCode_ptr tc, case CORBA::tk_array: case CORBA::tk_alias: case CORBA::tk_except: - retval = stream->encode (param, data, 0, env); - break; case CORBA::tk_string: case CORBA::tk_wstring: + retval = stream->encode (param, data, 0, env); + break; case CORBA::tk_TypeCode: case CORBA::tk_objref: retval = stream->encode (param, &data, 0, env); @@ -801,6 +801,14 @@ TAO_Marshal_Sequence::encode (CORBA::TypeCode_ptr tc, break; case CORBA::tk_char: + // For primitives, compute the size only once + continue_encoding = continue_encoding && + stream->write_char_array + ((CORBA::Char*)value, bounds); + if (continue_encoding == CORBA::B_TRUE) + return CORBA::TypeCode::TRAVERSE_CONTINUE; + break; + case CORBA::tk_octet: // For primitives, compute the size only once continue_encoding = continue_encoding && diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 0210356cb15..be1afcd17a3 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -116,7 +116,7 @@ // This deals with platforms that support namespaces vs platforms that // don't. #if defined (ACE_HAS_USING_KEYWORD) -#define TAO_NAMESPACE namespace +#define TAO_NAMESPACE struct #else #define TAO_NAMESPACE struct #endif /* ACE_HAS_USING_KEYWORD */ @@ -147,6 +147,24 @@ // #define TAO_NO_COPY_OCTET_SEQUENCES +// Even though the strategy above minimizes copies in some cases it is +// more efficient just to copy the octet sequence, for instance, while +// enconding a "small" octet sequence in a buffer that has enough +// space. +// This parameter controls the default value for "small enough", but +// can also be set using the command line option -ORBCDRtradeoff +#define TAO_DEFAULT_CDR_MEMCPY_TRADEOFF 256 + +// The CDR growing strategy is control by several parameters: +// + The default or initial CDR buffer size. +// + From that value the CDR buffer is grown exponentially (size +// duplicated each time) until it reaches EXP_GROWTH_MAX. +// + From then on the buffer is grown linearly in chunks of +// LINEAR_GROWTH_MAX +#define TAO_DEFAULT_CDR_BUFSIZE 512 +#define TAO_DEFAULT_CDR_EXP_GROWTH_MAX 4096 +#define TAO_DEFAULT_CDR_LINEAR_GROWTH_CHUNK 4096 + // BC++ seems to have a different convention for detecting Win32 than // VC++. diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index df30d8c521b..207355e9ccb 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -10,7 +10,8 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void) : name_service_ior_ (0), name_service_port_ (0), sock_rcvbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ), - sock_sndbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ) + sock_sndbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ), + cdr_memcpy_tradeoff_ (TAO_DEFAULT_CDR_MEMCPY_TRADEOFF) { } diff --git a/TAO/tao/params.h b/TAO/tao/params.h index 8c41a2f1218..b775ce37561 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -105,6 +105,13 @@ public: // After reaching their maximum exponential size limit CDR streams // grow linearly in chunks of this size. + int cdr_memcpy_tradeoff (void) const; + void cdr_memcpy_tradeoff (int); + // Octet sequences are marshalled without doing any copies, we + // simply append a block to the CDR message block chain. When the + // octet sequence is small enough and there is room in the current + // message block it is more efficient just to copy the buffer. + private: ACE_INET_Addr addr_; // host + port number we are listening on @@ -135,6 +142,10 @@ private: int cdr_linear_chunk_; // Control for linear growth of CDR buffers. + + int cdr_memcpy_tradeoff_; + // Control the strategy for copying vs. appeding octet sequences in + // CDR streams. }; typedef enum diff --git a/TAO/tao/params.i b/TAO/tao/params.i index f4b8a76a182..665fd050be7 100644 --- a/TAO/tao/params.i +++ b/TAO/tao/params.i @@ -88,3 +88,16 @@ TAO_ORB_Parameters::sock_sndbuf_size (int s) { sock_sndbuf_size_ = s <= ACE_DEFAULT_MAX_SOCKET_BUFSIZ ? s : ACE_DEFAULT_MAX_SOCKET_BUFSIZ; } + +ACE_INLINE int +TAO_ORB_Parameters::cdr_memcpy_tradeoff (void) const +{ + return this->cdr_memcpy_tradeoff_; +} + +ACE_INLINE void +TAO_ORB_Parameters::cdr_memcpy_tradeoff (int x) +{ + this->cdr_memcpy_tradeoff_ = x; +} + diff --git a/TAO/tests/CDR/CDR.dsw b/TAO/tests/CDR/CDR.dsw index 827e0a5c2e5..f634d83faa0 100644 --- a/TAO/tests/CDR/CDR.dsw +++ b/TAO/tests/CDR/CDR.dsw @@ -15,6 +15,18 @@ Package=<4> ###############################################################################
+Project: "growth"=.\growth.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "tc"=.\tc.dsp - Package Owner=<4>
Package=<5>
diff --git a/TAO/tests/CDR/growth.cpp b/TAO/tests/CDR/growth.cpp index 9f72c020906..69d42afb782 100644 --- a/TAO/tests/CDR/growth.cpp +++ b/TAO/tests/CDR/growth.cpp @@ -141,8 +141,8 @@ main (int argc, char *argv[]) rusecs *= ACE_static_cast (ACE_UINT32, ACE_ONE_SECOND_IN_USECS); rusecs += rtv.usec (); - double write_average = wusecs / m; - double read_average = rusecs / m; + double write_average = ACE_static_cast(ACE_INT32, wusecs) / m; + double read_average = ACE_static_cast(ACE_INT32, rusecs) / m; ACE_OS::printf ("AVE: %d %f %f\n", x, write_average, read_average); } diff --git a/TAO/tests/CDR/growth.dsp b/TAO/tests/CDR/growth.dsp new file mode 100644 index 00000000000..84450e8a4ed --- /dev/null +++ b/TAO/tests/CDR/growth.dsp @@ -0,0 +1,87 @@ +# Microsoft Developer Studio Project File - Name="growth" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=growth - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "growth.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "growth.mak" CFG="growth - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "growth - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "growth - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "growth - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "growth - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\\" /I "..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 aced.lib TAO.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\ace" /libpath:"..\..\tao"
+
+!ENDIF
+
+# Begin Target
+
+# Name "growth - Win32 Release"
+# Name "growth - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\growth.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/TAO/tests/CDR/growth.dsw b/TAO/tests/CDR/growth.dsw new file mode 100644 index 00000000000..0b525c90763 --- /dev/null +++ b/TAO/tests/CDR/growth.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "growth"=.\growth.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/client.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/client.cpp index 3c224a261c6..5f4462d7fe1 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/client.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/client.cpp @@ -778,7 +778,7 @@ Cubit_Client::run (void) // Make the calls in a loop. for (i = 0; i < this->loop_count_; i++) - this->cube_sequence (this->loop_count_, 256); + this->cube_sequence (this->loop_count_, 1024); timer.stop (); @@ -810,7 +810,7 @@ Cubit_Client::run (void) // Make the calls in a loop. for (i = 0; i < this->loop_count_; i++) - this->cube_raw (this->loop_count_, 1024); + this->cube_raw (this->loop_count_, 4096); timer.stop (); diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/client.dsp b/TAO/tests/Cubit/TAO/IDL_Cubit/client.dsp index 4d1f050c6a1..bd2ee9cd0b9 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/client.dsp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/client.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\tao\\" /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 aced.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\tao\\" /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
!ELSEIF "$(CFG)" == "client - Win32 Debug"
diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp index 7ae1dde75d0..86faf4ef770 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp @@ -144,8 +144,9 @@ Cubit_i::cube_sequence(const Cubit::vector &input, output[i] = x * x * x; } #else + CORBA::ULong i = 0; CORBA::Long x = input[0]; - output[0] = x * x * x; + output[i] = x * x * x; #endif } @@ -167,8 +168,9 @@ Cubit_i::cube_raw (const Cubit::Raw &input, output[i] = x * x * x; } #else + CORBA::ULong i = 0; CORBA::Octet x = input[0]; - output[0] = x * x * x; + output[i] = x * x * x; #endif } diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/server.dsp b/TAO/tests/Cubit/TAO/IDL_Cubit/server.dsp index 124f329f894..37d417aaed7 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/server.dsp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/server.dsp @@ -49,7 +49,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\tao\\" /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
+# ADD LINK32 aced.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\tao\\" /libpath:"..\..\..\..\..\ace" /libpath:"..\..\..\..\orbsvcs\orbsvcs"
!ELSEIF "$(CFG)" == "server - Win32 Debug"
diff --git a/TAO/tests/Cubit/TAO/MT_Cubit/server.dsp b/TAO/tests/Cubit/TAO/MT_Cubit/server.dsp index 7e2fb67e084..3016ab93cb1 100644 --- a/TAO/tests/Cubit/TAO/MT_Cubit/server.dsp +++ b/TAO/tests/Cubit/TAO/MT_Cubit/server.dsp @@ -73,7 +73,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 aced.lib TAO.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
+# ADD LINK32 aced.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\orbsvcs\orbsvcs" /libpath:"..\..\..\..\tao" /libpath:"..\..\..\..\..\ace"
!ENDIF
diff --git a/TAO/tests/OctetSeq/OctetSeq.cpp b/TAO/tests/OctetSeq/OctetSeq.cpp index f1b305b2efd..f721ccd3f23 100644 --- a/TAO/tests/OctetSeq/OctetSeq.cpp +++ b/TAO/tests/OctetSeq/OctetSeq.cpp @@ -113,7 +113,7 @@ run (char* buf, size_t bufsize, for (size_t i = 0; i < n; ++i) { writing.start_incr (); - TAO_OutputCDR output (bufsize + 4); + TAO_OutputCDR output; if (writer (output, buf, x, env) != 0) return -1; @@ -139,8 +139,8 @@ run (char* buf, size_t bufsize, rusecs *= ACE_static_cast (ACE_UINT32, ACE_ONE_SECOND_IN_USECS); rusecs += rtv.usec (); - double write_average = wusecs / m; - double read_average = rusecs / m; + double write_average = ACE_reinterpret_cast(ACE_INT32,wusecs) / m; + double read_average = ACE_reinterpret_cast(ACE_INT32,rusecs) / m; ACE_DEBUG ((LM_DEBUG, "%s: %d %.3f %.3f\n", name, x, write_average, read_average)); @@ -243,6 +243,6 @@ main (int argc, char *argv[]) #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class TAO_Unbounded_Sequence<CORBA::Char>; -#else +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate TAO_Unbounded_Sequence<CORBA::Char> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tests/OctetSeq/OctetSeq.dsp b/TAO/tests/OctetSeq/OctetSeq.dsp new file mode 100644 index 00000000000..1e382a5b680 --- /dev/null +++ b/TAO/tests/OctetSeq/OctetSeq.dsp @@ -0,0 +1,141 @@ +# Microsoft Developer Studio Project File - Name="OctetSeq" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=OctetSeq - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "OctetSeq.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "OctetSeq.mak" CFG="OctetSeq - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "OctetSeq - Win32 Release" (based on\
+ "Win32 (x86) Console Application")
+!MESSAGE "OctetSeq - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "OctetSeq - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "OctetSeq - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 aced.lib TAO.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "OctetSeq - Win32 Release"
+# Name "OctetSeq - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\OctetSeq.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\testC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\testS.cpp
+# End Source File
+# End Group
+# Begin Group "IDL Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\test.idl
+
+!IF "$(CFG)" == "OctetSeq - Win32 Release"
+
+!ELSEIF "$(CFG)" == "OctetSeq - Win32 Debug"
+
+# Begin Custom Build - Invoking TAO IDL compiler
+InputPath=.\test.idl
+InputName=test
+
+BuildCmds= \
+ ..\..\tao_idl\tao_idl $(InputName).idl
+
+"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/OctetSeq/OctetSeq.dsw b/TAO/tests/OctetSeq/OctetSeq.dsw new file mode 100644 index 00000000000..e0a2dad0331 --- /dev/null +++ b/TAO/tests/OctetSeq/OctetSeq.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "OctetSeq"=.\OctetSeq.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/Param_Test/tests.cpp b/TAO/tests/Param_Test/tests.cpp index bcd82710008..03a0e4332df 100644 --- a/TAO/tests/Param_Test/tests.cpp +++ b/TAO/tests/Param_Test/tests.cpp @@ -719,7 +719,7 @@ Test_Bounded_String_Sequence::init_parameters (Param_Test_ptr objref, // the sequence // char *str = gen->gen_string (); //this->in_[i] = str; - this->in_[i] = choiceList[i]; + this->in_[i] = choiceList[i%3]; } return 0; |