summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2006-08-04 09:07:09 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2006-08-04 09:07:09 +0000
commita6fa5d11395d96399c32d872d270428315247071 (patch)
treea8abe1936e1022c16d0d8bc297beddcdf589e867
parentf99e4247002cf5821bcc924659891802d667a459 (diff)
downloadATCD-a6fa5d11395d96399c32d872d270428315247071.tar.gz
Fri Aug 4 09:06:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/ChangeLog15
-rw-r--r--TAO/docs/Options.html4
-rw-r--r--TAO/tao/IIOP_Transport.cpp4
-rw-r--r--TAO/tao/IIOP_Transport.h4
-rw-r--r--TAO/tao/MMAP_Allocator.cpp5
-rw-r--r--TAO/tao/MMAP_Allocator.h4
-rw-r--r--TAO/tao/Transport.cpp12
-rw-r--r--TAO/tao/Transport.h8
-rw-r--r--TAO/tao/default_resource.cpp12
-rw-r--r--TAO/tao/default_resource.h4
-rw-r--r--TAO/tao/orbconf.h11
11 files changed, 56 insertions, 27 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 1e2e1e55fd5..f74dda7a536 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,18 @@
+Fri Aug 4 09:06:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tao/default_resource.{h,cpp}:
+ * tao/IIOP_Transport.{h,cpp}:
+ * tao/MMAP_Allocator.{h,cpp}:
+ * tao/orbconf.h:
+ * tao/Transport.{h,cpp}:
+ * docs/Options.html:
+ Added TAO_HAS_SENDFILE, this is set to 1 when ACE_HAS_SENDFILE
+ is enabled, else it is set to 0. Users can explicitly define
+ this to 0 also to build TAO without sendfile support, this
+ reduces then the footprint for applications running on a
+ platform that supports sendfile but where the app doesn't
+ use it. This fixes bugzilla bug 2587.
+
Wed Aug 2 22:47:53 UTC 2006 Phil Mesnier <mesnier_p@ociweb.com>
* NEWS:
diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html
index ddd4e15a57c..b69858a70a4 100644
--- a/TAO/docs/Options.html
+++ b/TAO/docs/Options.html
@@ -1082,6 +1082,10 @@ until all the data is sent.
<td><code>-ORBZeroCopyWrite</code> </td>
<td><a name="-ORBZeroCopyWrite"></a> Use a zero copy write
protocol, which at this moment the only option is sendfile.
+ If your platform does support sendfile but you don't want
+ that TAO uses it you can disable
+ sendfile in TAO by add the define <code>TAO_HAS_SENDFILE 0</code>
+ to your config.h file.
</td>
</tr>
</tbody>
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index e40e21738c5..9ca5e3de92c 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -95,7 +95,7 @@ TAO_IIOP_Transport::send (iovec *iov, int iovcnt,
return retval;
}
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
ssize_t
TAO_IIOP_Transport::sendfile (TAO_MMAP_Allocator * allocator,
iovec * iov,
@@ -173,7 +173,7 @@ TAO_IIOP_Transport::sendfile (TAO_MMAP_Allocator * allocator,
return retval;
}
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
ssize_t
TAO_IIOP_Transport::recv (char *buf,
diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h
index 70c99088a0a..6bc63f11934 100644
--- a/TAO/tao/IIOP_Transport.h
+++ b/TAO/tao/IIOP_Transport.h
@@ -84,13 +84,13 @@ protected:
size_t &bytes_transferred,
const ACE_Time_Value *timeout = 0);
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
virtual ssize_t sendfile (TAO_MMAP_Allocator * allocator,
iovec * iov,
int iovcnt,
size_t &bytes_transferred,
ACE_Time_Value const * timeout = 0);
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
virtual ssize_t recv (char *buf,
diff --git a/TAO/tao/MMAP_Allocator.cpp b/TAO/tao/MMAP_Allocator.cpp
index cdb740fb347..a77884aa272 100644
--- a/TAO/tao/MMAP_Allocator.cpp
+++ b/TAO/tao/MMAP_Allocator.cpp
@@ -2,8 +2,7 @@
#include "tao/MMAP_Allocator.h"
-
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
#include "ace/Mem_Map.h"
#include "ace/Default_Constants.h"
@@ -96,4 +95,4 @@ TAO_MMAP_Allocator::offset (void * p)
TAO_END_VERSIONED_NAMESPACE_DECL
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
diff --git a/TAO/tao/MMAP_Allocator.h b/TAO/tao/MMAP_Allocator.h
index ebf78a68b8c..08f3295ecfd 100644
--- a/TAO/tao/MMAP_Allocator.h
+++ b/TAO/tao/MMAP_Allocator.h
@@ -21,7 +21,7 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
#include "ace/Malloc_T.h"
#include "ace/MMAP_Memory_Pool.h"
@@ -70,7 +70,7 @@ private:
TAO_END_VERSIONED_NAMESPACE_DECL
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
#include /**/ "ace/post.h"
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp
index 2fb6629f852..7f3c7ebf4b2 100644
--- a/TAO/tao/Transport.cpp
+++ b/TAO/tao/Transport.cpp
@@ -139,7 +139,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag,
, tcs_set_ (0)
, first_request_ (1)
, partial_message_ (0)
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
// The ORB has been configured to use the MMAP allocator, meaning
// we could/should use sendfile() to send data. Cast once rather
// here rather than during each send. This assumes that all
@@ -148,7 +148,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag,
, mmap_allocator_ (
dynamic_cast<TAO_MMAP_Allocator *> (
orb_core->output_cdr_buffer_allocator ()))
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
{
TAO_Client_Strategy_Factory *cf =
this->orb_core_->client_factory ();
@@ -329,7 +329,7 @@ TAO_Transport::register_handler (void)
ACE_Event_Handler::READ_MASK);
}
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
ssize_t
TAO_Transport::sendfile (TAO_MMAP_Allocator * /* allocator */,
iovec * iov,
@@ -346,7 +346,7 @@ TAO_Transport::sendfile (TAO_MMAP_Allocator * /* allocator */,
// -Ossama
return this->send (iov, iovcnt, bytes_transferred, timeout);
}
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
int
TAO_Transport::generate_locate_request (
@@ -832,14 +832,14 @@ TAO_Transport::drain_queue_helper (int &iovcnt, iovec iov[])
// ... send the message ...
ssize_t retval = -1;
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
if (this->mmap_allocator_)
retval = this->sendfile (this->mmap_allocator_,
iov,
iovcnt,
byte_count);
else
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
retval = this->send (iov, iovcnt, byte_count);
if (TAO_debug_level == 5)
diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h
index a801f8fff39..a563cc42727 100644
--- a/TAO/tao/Transport.h
+++ b/TAO/tao/Transport.h
@@ -399,7 +399,7 @@ public:
size_t &bytes_transferred,
const ACE_Time_Value *timeout = 0) = 0;
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
/// Send data through zero-copy write mechanism, if available.
/**
* This method sends the data in the I/O vector through the platform
@@ -415,7 +415,7 @@ public:
int iovcnt,
size_t &bytes_transferred,
ACE_Time_Value const * timeout = 0);
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
/// Read len bytes from into buf.
@@ -1047,14 +1047,14 @@ private:
/// Holds the partial GIOP message (if there is one)
ACE_Message_Block* partial_message_;
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
/// mmap()-based allocator used to allocator output CDR buffers.
/**
* If this pointer is non-zero, sendfile() will be used to send data
* in a TAO_OutputCDR stream instance.
*/
TAO_MMAP_Allocator * const mmap_allocator_;
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
/*
* specialization hook to add class members from concrete
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index e77480caef3..67095ea740c 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -490,12 +490,12 @@ TAO_Default_Resource_Factory::init (int argc, ACE_TCHAR *argv[])
if (ACE_OS::strcasecmp (current_arg,
ACE_TEXT("mmap")) == 0)
{
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
this->output_cdr_allocator_type_ = MMAP_ALLOCATOR;
#else
ACE_DEBUG ((LM_WARNING,
ACE_TEXT ("MMAP allocator unsupport on this platform")));
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
}
else if (ACE_OS::strcasecmp (current_arg,
ACE_TEXT("local_memory_pool")) == 0
@@ -518,12 +518,12 @@ TAO_Default_Resource_Factory::init (int argc, ACE_TCHAR *argv[])
else if (0 == ACE_OS::strcasecmp (argv[curarg],
ACE_TEXT("-ORBZeroCopyWrite")))
{
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
this->output_cdr_allocator_type_ = MMAP_ALLOCATOR;
#else
ACE_DEBUG ((LM_WARNING,
ACE_TEXT ("Zero copy writes unsupported on this platform\n")));
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
}
else if (ACE_OS::strncmp (argv[curarg],
ACE_TEXT ("-ORB"),
@@ -874,14 +874,14 @@ TAO_Default_Resource_Factory::output_cdr_buffer_allocator (void)
break;
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
case MMAP_ALLOCATOR:
ACE_NEW_RETURN (allocator,
TAO_MMAP_Allocator,
0);
break;
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE==1 */
case DEFAULT:
default:
diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h
index 924364b681c..8c04fa14372 100644
--- a/TAO/tao/default_resource.h
+++ b/TAO/tao/default_resource.h
@@ -220,9 +220,9 @@ protected:
enum Output_CDR_Allocator_Type
{
LOCAL_MEMORY_POOL,
-#ifdef ACE_HAS_SENDFILE
+#if TAO_HAS_SENDFILE == 1
MMAP_ALLOCATOR,
-#endif /* ACE_HAS_SENDFILE */
+#endif /* TAO_HAS_SENDFILE == 1*/
DEFAULT
};
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index a8ab7fcec9c..5776b72bc4e 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -684,6 +684,17 @@ const size_t TAO_DEFAULT_VALUE_FACTORY_TABLE_SIZE = 128;
# endif /* TAO_HAS_MINIMUM_CORBA */
#endif
+// At the moment we have sendfile support in ACE we enabled this also by
+// default for TAO, but we can suppress it also explicitly by set
+// TAO_HAS_SENDFILE to 0.
+#if !defined (TAO_HAS_SENDFILE)
+# if defined ACE_HAS_SENDFILE
+# define TAO_HAS_SENDFILE 1
+# else
+# define TAO_HAS_SENDFILE 0
+# endif /* ACE_HAS_SENDFILE */
+#endif /* !TAO_HAS_SENDFILE */
+
// Proprietary FT interception-point support is disabled by default.
#ifndef TAO_HAS_EXTENDED_FT_INTERCEPTORS
# define TAO_HAS_EXTENDED_FT_INTERCEPTORS 0