[omniORB] strings versus char arrays

Wilson Jimmy - jiwils Jimmy.Wilson@acxiom.com
Tue Sep 17 17:16:02 2002


There is an ongoing debate where I work on whether or not to use the CORBA
string IDL type or a NULL terminated character array in some instances.

While I object to the use of the NULL terminated character array because it
is a language dependant representation of a string, I would like to
understand if there is really a performance benefit with using the array.

Unless we're talking about several hundred bytes the network impact for
using a fixed array versus the variable string is not significant (I would
think anyway), but what about from a memory standpoint on the servant side
of things?

Ultimately, memory is going to be allocated regardless of the type used
right?  In the string case, the programmer can have explicit control over
the allocation/deallocation of memory, but with the character array, isn't
the ORB doing a new underneath as well?  Given that, is any more time spent
doing memory housekeeping with one or the other?

Are there other benefits to using a character array that I am not seeing
here?  In reality, I don't understand why we keeping having this debate.
Can anyone point me to any reference material that would be of good use when
discussing this?

Jimmy
-- 
James "Jimmy" Wilson


*********************************************************************

The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.