diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-05 00:33:30 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-05 00:33:30 +0000 |
commit | a475108462621d9b151cde7f709abace545b1dcf (patch) | |
tree | 480705c6ffbbf2defd5b614b3cb2498f6ce12d3d | |
parent | 1477c6e112f4a139c9d5a206663a1d7ab648bbde (diff) | |
download | ATCD-a475108462621d9b151cde7f709abace545b1dcf.tar.gz |
foo
-rw-r--r-- | ChangeLog-97a | 20 | ||||
-rw-r--r-- | ace/Message_Block.cpp | 24 | ||||
-rw-r--r-- | ace/Message_Block.h | 4 | ||||
-rw-r--r-- | ace/OS.cpp | 14 | ||||
-rw-r--r-- | ace/OS.h | 35 | ||||
-rw-r--r-- | ace/OS.i | 18 | ||||
-rw-r--r-- | ace/Synch.h | 2 | ||||
-rw-r--r-- | ace/config-aix-3.2.5.h | 2 | ||||
-rw-r--r-- | ace/config-aix-4.1.x.h | 2 | ||||
-rw-r--r-- | ace/config-aix-4.2.x.h | 2 | ||||
-rw-r--r-- | ace/config-dgux-4.11-epc.h | 183 |
11 files changed, 254 insertions, 52 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a index 3e8b609900a..ab5a447beef 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,3 +1,23 @@ +Tue Feb 4 15:08:55 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * examples/Misc/test_iostreams.cpp: Added a test that illustrates + how the new ACE_iostreams mechanism works. Thanks to James CE + Johnson <jcej@lads.com> for this. + + * ace/Message_Block: Updated the ACE_Message_Block implementation + to use ACE_Service_Config::alloc() if the user doesn't supply a + customize version. This also means that we never delete the + allocator_strategy_, so we can remove this flag and reduce the + amount of storage by 4 bytes. Thanks to Irfan for noticing that + we can do this. + + * ace/platform_dgux4_epc.h: Added a new platform config file + for DG/UX. Thanks to Michael Maxie <maxie@acm.org> for + this. + + * ace/config-dgux-4.11-epc.h: Added a new config file for DG/UX. + Thanks to Michael Maxie <maxie@acm.org> for this. + Mon Feb 3 15:35:24 1997 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * ace/config-aix-*.h: Added a (char *) cast to diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 2d4721af48b..211492011e8 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -10,8 +10,6 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Message_Block) -typedef ACE_Allocator_Adapter <ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_Null_Mutex> > ACE_NEW_MALLOC; - void ACE_Message_Block::data_block (ACE_Data_Block *db) { @@ -179,12 +177,6 @@ ACE_Data_Block::~ACE_Data_Block (void) this->allocator_strategy_->free ((void *) this->base_); this->base_ = 0; } - - if (this->delete_allocator_strategy_) - { - delete this->allocator_strategy_; - this->allocator_strategy_ = 0; - } } ACE_Message_Block::~ACE_Message_Block (void) @@ -212,7 +204,6 @@ ACE_Data_Block::ACE_Data_Block (void) flags_ (ACE_Message_Block::DONT_DELETE), base_ (0), allocator_strategy_ (0), - delete_allocator_strategy_ (0), locking_strategy_ (0), reference_count_ (1) { @@ -231,17 +222,15 @@ ACE_Data_Block::ACE_Data_Block (size_t size, flags_ (flags), base_ ((char *) msg_data), allocator_strategy_ (allocator_strategy), - delete_allocator_strategy_ (0), locking_strategy_ (locking_strategy), reference_count_ (1) { ACE_TRACE ("ACE_Data_Block::ACE_Data_Block"); + // If the user didn't pass one in, let's use the + // <ACE_Service_Config::alloc>. if (this->allocator_strategy_ == 0) - { - ACE_NEW (this->allocator_strategy_, ACE_NEW_MALLOC); - this->delete_allocator_strategy_ = 1; - } + ACE_ALLOCATOR (this->allocator_strategy_, ACE_Service_Config::alloc ()); if (msg_data == 0) ACE_ALLOCATOR (this->base_, @@ -590,12 +579,7 @@ ACE_Data_Block::clone (ACE_Message_Block::Message_Flags mask) const ACE_Data_Block (this->max_size_, // size this->type_, // type 0, // data - // Make sure not to copy the - // allocator_strategy_ pointer if - // we're planning to delete it! - this->delete_allocator_strategy_ - ? 0 - : this->allocator_strategy_, // allocator + this->allocator_strategy_, // allocator this->locking_strategy_, // locking strategy this->flags_), // flags 0); diff --git a/ace/Message_Block.h b/ace/Message_Block.h index ec3a5f28ede..76227a407be 100644 --- a/ace/Message_Block.h +++ b/ace/Message_Block.h @@ -458,10 +458,6 @@ private: // that this pointer is shared by all owners of this // <ACE_Data_Block>. - int delete_allocator_strategy_; - // Keep track of whether we have to delete the <allocator_strategy_> - // pointer. - ACE_Lock *locking_strategy_; // Pointer to the locking strategy defined for this // <ACE_Data_Block>. This is used to protect regions of code that diff --git a/ace/OS.cpp b/ace/OS.cpp index 89b4d2fc320..5cdd0e749c0 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -87,6 +87,16 @@ ACE_Time_Value::set (long sec, long usec) this->tv_usec_ = usec; } +void +ACE_Time_Value::set (double d) +{ + // ACE_TRACE ("ACE_Time_Value::set"); + long l = (long) d; + this->tv_sec_ = l; + this->tv_usec_ = ((long) (d - (double) l)) * 1000000; + this->normalize (); +} + ACE_Time_Value::ACE_Time_Value (long sec, long usec) { // ACE_TRACE ("ACE_Time_Value::ACE_Time_Value"); @@ -368,9 +378,9 @@ ACE_OS::inet_ntoa (const struct in_addr addr) #endif /* VXWORKS */ void -ACE_OS::flock_t::dump (void) const +ACE_OS::ace_flock_t::dump (void) const { -// ACE_TRACE ("ACE_OS::flock_t::dump"); +// ACE_TRACE ("ACE_OS::ace_flock_t::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, "handle_ = %u", this->handle_)); @@ -306,8 +306,8 @@ class ACE_Export ACE_Time_Value // = DESCRIPTION // This class centralizes all the time-related processing in // ACE. These timers are typically used in conjunction with - // lower-level OS mechanisms like select(), poll(), or - // cond_timedwait(). ACE_Time_Value help make the use of these + // lower-level OS mechanisms like <select>, <poll>, or + // <cond_timedwait>. ACE_Time_Value help make the use of these // mechanisms portable across OS platforms, { public: @@ -318,7 +318,7 @@ public: // = Initialization methods. ACE_Time_Value (long sec = 0, long usec = 0); - // Constructor (needed to avoid conflict with the <double> version). + // Constructor. // = Methods for converting to/from various time formats. ACE_Time_Value (const struct timeval &t); @@ -335,8 +335,11 @@ public: // Initializes the ACE_Time_Value object from a Win32 FILETIME #endif - void set (long sec = 0, long usec = 0); - // Construct a Time_Value from a timeval. + void set (long sec, long usec); + // Construct a Time_Value from two <long>s. + + void set (double d); + // Construct a Time_Value from a <double>. void set (const timeval &t); // Construct a Time_Value from a timeval. @@ -1264,6 +1267,12 @@ typedef void (*ACE_SignalHandlerV)(...); typedef void (*ACE_SignalHandlerV)(...); #endif /* ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES */ +#if defined (BUFSIZ) +#define ACE_STREAMBUF_SIZE BUFSIZ +#else +#define ACE_STREAMBUF_SIZE 1024 +#endif /* BUFSIZ */ + #if defined (ACE_WIN32) // Turn off warnings for /W4 // To resume any of these warning: #pragma warning(default: 4xxx) @@ -2241,7 +2250,7 @@ class ACE_Export ACE_OS // ACE_Log_Msg::restart() flag is enabled). { public: - struct flock_t + struct ace_flock_t // = TITLE // OS file locking structure. { @@ -2313,18 +2322,18 @@ public: static int sprintf (char *buf, const char *format, ...); // = A set of wrappers for file locks. - static int flock_init (ACE_OS::flock_t *lock, int flags = 0, + static int flock_init (ACE_OS::ace_flock_t *lock, int flags = 0, LPCTSTR name = 0, mode_t perms = 0); - static int flock_destroy (ACE_OS::flock_t *lock); - static int flock_rdlock (ACE_OS::flock_t *lock, short whence = 0, + static int flock_destroy (ACE_OS::ace_flock_t *lock); + static int flock_rdlock (ACE_OS::ace_flock_t *lock, short whence = 0, off_t start = 0, off_t len = 0); - static int flock_tryrdlock (ACE_OS::flock_t *lock, short whence = 0, + static int flock_tryrdlock (ACE_OS::ace_flock_t *lock, short whence = 0, off_t start = 0, off_t len = 0); - static int flock_trywrlock (ACE_OS::flock_t *lock, short whence = 0, + static int flock_trywrlock (ACE_OS::ace_flock_t *lock, short whence = 0, off_t start = 0, off_t len = 0); - static int flock_unlock (ACE_OS::flock_t *lock, short whence = 0, + static int flock_unlock (ACE_OS::ace_flock_t *lock, short whence = 0, off_t start = 0, off_t len = 0); - static int flock_wrlock (ACE_OS::flock_t *lock, short whence = 0, + static int flock_wrlock (ACE_OS::ace_flock_t *lock, short whence = 0, off_t start = 0, off_t len = 0); // = A set of wrappers for low-level process operations. @@ -5297,7 +5297,7 @@ ACE_OS::asctime_r (const struct tm *t, char *buf, int buflen) } ACE_INLINE int -ACE_OS::flock_init (ACE_OS::flock_t *lock, +ACE_OS::flock_init (ACE_OS::ace_flock_t *lock, int flags, LPCTSTR name, mode_t perms) @@ -5325,7 +5325,7 @@ ACE_OS::flock_init (ACE_OS::flock_t *lock, } ACE_INLINE int -ACE_OS::flock_wrlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t len) +ACE_OS::flock_wrlock (ACE_OS::ace_flock_t *lock, short whence, off_t start, off_t len) { // ACE_TRACE ("ACE_OS::flock_wrlock"); #if defined (ACE_WIN32) @@ -5348,7 +5348,7 @@ ACE_OS::flock_wrlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t le } ACE_INLINE int -ACE_OS::flock_rdlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t len) +ACE_OS::flock_rdlock (ACE_OS::ace_flock_t *lock, short whence, off_t start, off_t len) { // ACE_TRACE ("ACE_OS::flock_rdlock"); #if defined (ACE_WIN32) @@ -5371,9 +5371,9 @@ ACE_OS::flock_rdlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t le } ACE_INLINE int -ACE_OS::flock_trywrlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t len) +ACE_OS::flock_trywrlock (ACE_OS::ace_flock_t *lock, short whence, off_t start, off_t len) { - // ACE_TRACE ("ACE_OS::flock_trywrlock"); + // ACE_TRACE ("ACE_OS::ace_flock_trywrlock"); #if defined (ACE_WIN32) ACE_UNUSED_ARG(whence); lock->overlapped_.Offset = start; @@ -5395,9 +5395,9 @@ ACE_OS::flock_trywrlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t } ACE_INLINE int -ACE_OS::flock_tryrdlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t len) +ACE_OS::flock_tryrdlock (ACE_OS::ace_flock_t *lock, short whence, off_t start, off_t len) { - // ACE_TRACE ("ACE_OS::flock_tryrdlock"); + // ACE_TRACE ("ACE_OS::ace_flock_tryrdlock"); #if defined (ACE_WIN32) ACE_UNUSED_ARG(whence); lock->overlapped_.Offset = start; @@ -5419,7 +5419,7 @@ ACE_OS::flock_tryrdlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t } ACE_INLINE int -ACE_OS::flock_unlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t len) +ACE_OS::flock_unlock (ACE_OS::ace_flock_t *lock, short whence, off_t start, off_t len) { // ACE_TRACE ("ACE_OS::flock_unlock"); #if defined (ACE_WIN32) @@ -5443,7 +5443,7 @@ ACE_OS::flock_unlock (ACE_OS::flock_t *lock, short whence, off_t start, off_t le } ACE_INLINE int -ACE_OS::flock_destroy (ACE_OS::flock_t *lock) +ACE_OS::flock_destroy (ACE_OS::ace_flock_t *lock) { // ACE_TRACE ("ACE_OS::flock_destroy"); if (lock->handle_ != ACE_INVALID_HANDLE) diff --git a/ace/Synch.h b/ace/Synch.h index a07658ff5c4..5d12739db90 100644 --- a/ace/Synch.h +++ b/ace/Synch.h @@ -145,7 +145,7 @@ public: // Declare the dynamic allocation hooks. protected: - ACE_OS::flock_t lock_; + ACE_OS::ace_flock_t lock_; // Locking structure for OS record locks. // = Prevent assignment and initialization. diff --git a/ace/config-aix-3.2.5.h b/ace/config-aix-3.2.5.h index 8a819b780c9..dbb7d5e725c 100644 --- a/ace/config-aix-3.2.5.h +++ b/ace/config-aix-3.2.5.h @@ -8,7 +8,7 @@ #define MAXNAMELEN 1024 -#define ACE_DEFAULT_BASE_ADDR 0x80000000 +#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R #define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES diff --git a/ace/config-aix-4.1.x.h b/ace/config-aix-4.1.x.h index e9ca6069262..3ebb27bc1ae 100644 --- a/ace/config-aix-4.1.x.h +++ b/ace/config-aix-4.1.x.h @@ -20,7 +20,7 @@ // Compiling for AIX. #define AIX -#define ACE_DEFAULT_BASE_ADDR 0x80000000 +#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) #define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R #define _BSD 44 diff --git a/ace/config-aix-4.2.x.h b/ace/config-aix-4.2.x.h index dd33ca221d5..302f31c0592 100644 --- a/ace/config-aix-4.2.x.h +++ b/ace/config-aix-4.2.x.h @@ -12,7 +12,7 @@ #define _BSD 44 #define ACE_HAS_AIX_HI_RES_TIMER -#define ACE_DEFAULT_BASE_ADDR 0x80000000 +#define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) #define ACE_HAS_UNION_WAIT #define ACE_HAS_MULTICAST #define ACE_HAS_TID_T diff --git a/ace/config-dgux-4.11-epc.h b/ace/config-dgux-4.11-epc.h new file mode 100644 index 00000000000..095af26e8cf --- /dev/null +++ b/ace/config-dgux-4.11-epc.h @@ -0,0 +1,183 @@ +// The following configuration file is designed to work for DG/UX +// 4.11 platforms using the EPC compiler. + +#if !defined (ACE_CONFIG_H) +#define ACE_CONFIG_H + +// Platform supports System V IPC (most versions of UNIX, but not Win32) +#define ACE_HAS_SYSV_IPC + +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Platform supports system configuration information. +#define ACE_HAS_SYSINFO + +// Platform supports the POSIX regular expression library. +#define ACE_HAS_REGEX + +// Platform supports recvmsg and sendmsg. +#define ACE_HAS_MSG + +// Compiler/platform contains the <sys/syscall.h> file. +// #define ACE_HAS_SYSCALL_H + +// Platform supports reentrant functions (i.e., all the POSIX *_r functions). +#define ACE_HAS_REENTRANT_FUNCTIONS + +// Platform has terminal ioctl flags like TCGETS and TCSETS. +#define ACE_HAS_TERM_IOCTLS + +// Compiler/platform correctly calls init()/fini() for shared libraries. +#define ACE_HAS_AUTOMATIC_INIT_FINI + +// Platform supports POSIX O_NONBLOCK semantics. +#define ACE_HAS_POSIX_NONBLOCK + +// Compiler/platform has correctly prototyped header files. +#define ACE_HAS_CPLUSPLUS_HEADERS + +// Compiler/platform supports SunOS high resolution timers. +// #define ACE_HAS_HI_RES_TIMER + +// Platform supports IP multicast +#define ACE_HAS_IP_MULTICAST + +// Compiler/platform supports the "long long" datatype. +// #define ACE_HAS_LONGLONG_T + +// Compiler/platform supports alloca() +// #define ACE_HAS_ALLOCA + +// Compiler/platform has <alloca.h> +// #define ACE_HAS_ALLOCA_H + +// Sockets may be called in multi-threaded programs. +#define ACE_HAS_MT_SAFE_SOCKETS + +// Platform contains <poll.h>. +#define ACE_HAS_POLL + +// Platform supports POSIX timers via timestruc_t. +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_SVR4_TIME + +// Platform supports the /proc file system. +#define ACE_HAS_PROC_FS + +// Platform supports the prusage_t struct. +// #define ACE_HAS_PRUSAGE_T +#define ACE_HAS_GETRUSAGE + +// Explicit dynamic linking permits "lazy" symbol resolution. +// #define ACE_HAS_RTLD_LAZY_V + +// Compiler/platform defines the sig_atomic_t typedef. +#define ACE_HAS_SIG_ATOMIC_T + +// Platform supports SVR4 extended signals. +#define ACE_HAS_SIGINFO_T + +// Compiler/platform provides the sockio.h file. +#define ACE_HAS_SOCKIO_H + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Platform supports STREAMS. +#define ACE_HAS_STREAMS + +// Platform supports STREAM pipes. +#define ACE_HAS_STREAM_PIPES + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// Compiler/platform supports struct strbuf. +#define ACE_HAS_STRBUF_T + +// Compiler/platform supports SVR4 dynamic linking semantics. +// #define ACE_HAS_SVR4_DYNAMIC_LINKING + +// Compiler/platform supports SVR4 gettimeofday() prototype. +// #define ACE_HAS_SVR4_GETTIMEOFDAY + +// DG/UX uses the same gettimeofday() prototype as OSF/1. +#define ACE_HAS_OSF1_GETTIMEOFDAY + +// Compiler/platform supports SVR4 signal typedef. +#define ACE_HAS_SVR4_SIGNAL_T + +// Compiler/platform supports SVR4 ACE_TLI (in particular, T_GETNAME stuff)... +#define ACE_HAS_SVR4_TLI + +// Platform provides <sys/filio.h> header. +// #define ACE_HAS_SYS_FILIO_H + +// Compiler/platform supports sys_siglist array. +#define ACE_HAS_SYS_SIGLIST + +/* Turn off the following four defines if you want to disable threading. */ +// Compile using multi-thread libraries. +// #define ACE_MT_SAFE + +// Platform supports threads. +// #define ACE_HAS_THREADS + +// Platform supports POSIX pthreads *and* Solaris threads! +// #define ACE_HAS_STHREADS +// #define ACE_HAS_PTHREADS +#define ACE_HAS_SIGWAIT +// #define ACE_LACKS_CONDATTR_PSHARED + +// Compiler/platform has thread-specific storage +// +#define ACE_HAS_THREAD_SPECIFIC_STORAGE + +// Reactor detects deadlock +// #define ACE_REACTOR_HAS_DEADLOCK_DETECTION + +// Platform supports ACE_TLI timod STREAMS module. +#define ACE_HAS_TIMOD_H + +// Platform supports ACE_TLI tiuser header. +#define ACE_HAS_TIUSER_H + +// Platform provides ACE_TLI function prototypes. +#define ACE_HAS_TLI_PROTOTYPES + +// Platform supports ACE_TLI. +#define ACE_HAS_TLI + +// Use the poll() event demultiplexor rather than select(). +//#define ACE_USE_POLL + +// Turns off the tracing feature. +#if !defined (ACE_NTRACE) +#define ACE_NTRACE 1 +#endif /* ACE_NTRACE */ + +// Defines the page size of the system. +#define ACE_PAGE_SIZE 4096 + +// #define _USING_POSIX4A_DRAFT6 +#define _POSIX_SOURCE +#define _DGUX_SOURCE +// #define ACE_TEMPLATES_REQUIRE_SPECIALIZATION +#define ACE_HAS_UCONTEXT_T +#define ACE_NEEDS_SYSTIME_H +#define ACE_HAS_NONCONST_GETBY +#define ACE_LACKS_MADVISE + +#if !defined (IP_ADD_MEMBERSHIP) +#define IP_ADD_MEMBERSHIP 0x13 +#endif + +#if !defined (IP_DROP_MEMBERSHIP) +#define IP_DROP_MEMBERSHIP 0x14 +#endif + +// Header files lack t_errno for ACE_TLI. +#define ACE_LACKS_T_ERRNO + +#define ACE_DGUX +#endif /* ACE_CONFIG_H */ |