#include <ZeroCopyAllocator_T.h>
Inheritance diagram for OpenDDS::DCPS::FirstTimeFastAllocator< T, N >:
Public Member Functions | |
FirstTimeFastAllocator () | |
virtual void * | malloc (size_t nbytes) |
virtual void | free (void *ptr) |
virtual void * | calloc (size_t nbytes, char initial_value= '\0') |
These methods are no-ops. | |
virtual void * | calloc (size_t n_elem, size_t elem_size, char initial_value= '\0') |
virtual int | remove () |
virtual int | bind (const char *name, void *pointer, int duplicates=0) |
virtual int | trybind (const char *name, void *&pointer) |
virtual int | find (const char *name, void *&pointer) |
virtual int | find (const char *name) |
virtual int | unbind (const char *name) |
virtual int | unbind (const char *name, void *&pointer) |
virtual int | sync (ssize_t len=-1, int flags=MS_SYNC) |
virtual int | sync (void *addr, size_t len, int flags=MS_SYNC) |
virtual int | protect (ssize_t len=-1, int prot=PROT_RDWR) |
virtual int | protect (void *addr, size_t len, int prot=PROT_RDWR) |
virtual void | dump () const |
T * | pool () |
Private Attributes | |
bool | firstTime_ |
is this the first time this is allocated? | |
T | pool_ [N] |
the pool of allocated memory. |
Definition at line 28 of file ZeroCopyAllocator_T.h.
ACE_INLINE OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::FirstTimeFastAllocator | ( | ) |
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::bind | ( | const char * | name, | |
void * | pointer, | |||
int | duplicates = 0 | |||
) | [virtual] |
Definition at line 57 of file ZeroCopyAllocator_T.cpp.
00058 {/* no-op */ 00059 ACE_ERROR((LM_ERROR, 00060 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00061 ACE_UNUSED_ARG(name); 00062 ACE_UNUSED_ARG(pointer); 00063 ACE_UNUSED_ARG(duplicates); 00064 return -1; 00065 }
void * OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::calloc | ( | size_t | n_elem, | |
size_t | elem_size, | |||
char | initial_value = '\0' | |||
) | [virtual] |
Definition at line 38 of file ZeroCopyAllocator_T.cpp.
00039 {/* no-op */ 00040 ACE_UNUSED_ARG(n_elem); 00041 ACE_UNUSED_ARG(elem_size); 00042 ACE_UNUSED_ARG(initial_value); 00043 return (void*)0; 00044 }
void * OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::calloc | ( | size_t | nbytes, | |
char | initial_value = '\0' | |||
) | [virtual] |
These methods are no-ops.
Definition at line 29 of file ZeroCopyAllocator_T.cpp.
00030 {/* no-op */ 00031 ACE_UNUSED_ARG(nbytes); 00032 ACE_UNUSED_ARG(initial_value); 00033 return (void*)0; 00034 }
void OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::dump | ( | ) | const [virtual] |
Definition at line 179 of file ZeroCopyAllocator_T.cpp.
00180 {/* no-op */ 00181 ACE_ERROR((LM_ERROR, 00182 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00183 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::find | ( | const char * | name | ) | [virtual] |
Definition at line 91 of file ZeroCopyAllocator_T.cpp.
00092 {/* no-op */ 00093 ACE_ERROR((LM_ERROR, 00094 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00095 ACE_UNUSED_ARG(name); 00096 return -1; 00097 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::find | ( | const char * | name, | |
void *& | pointer | |||
) | [virtual] |
Definition at line 80 of file ZeroCopyAllocator_T.cpp.
00081 {/* no-op */ 00082 ACE_ERROR((LM_ERROR, 00083 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00084 ACE_UNUSED_ARG(name); 00085 ACE_UNUSED_ARG(pointer); 00086 return -1; 00087 }
ACE_INLINE void OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::free | ( | void * | ptr | ) | [virtual] |
Definition at line 36 of file ZeroCopyAllocator_T.inl.
References OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::pool_.
00037 { 00038 if (ptr != (void*) pool_) { 00039 #if defined (ACE_HAS_ALLOC_HOOKS) 00040 ACE_Allocator::instance()->free(ptr); 00041 #else 00042 ACE_OS::free(ptr); 00043 #endif /* ACE_HAS_ALLOC_HOOKS */ 00044 } 00045 }
ACE_INLINE void * OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::malloc | ( | size_t | nbytes | ) | [virtual] |
Definition at line 19 of file ZeroCopyAllocator_T.inl.
References OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::firstTime_, and OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::pool_.
00020 { 00021 if (firstTime_ && nbytes <= N * sizeof(T)) { 00022 firstTime_ = false; 00023 return (void*) pool_; 00024 00025 } else { 00026 #if defined (ACE_HAS_ALLOC_HOOKS) 00027 return ACE_Allocator::instance()->malloc(nbytes); 00028 #else 00029 return ACE_OS::malloc(nbytes); 00030 #endif /* ACE_HAS_ALLOC_HOOKS */ 00031 } 00032 }
T* OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::pool | ( | ) | [inline] |
Definition at line 53 of file ZeroCopyAllocator_T.h.
Referenced by TAO::DCPS::ZeroCopyDataSeq< Sample_T, DEF_MAX >::swap().
00053 { 00054 return pool_; 00055 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::protect | ( | void * | addr, | |
size_t | len, | |||
int | prot = PROT_RDWR | |||
) | [virtual] |
Definition at line 156 of file ZeroCopyAllocator_T.cpp.
00157 {/* no-op */ 00158 ACE_ERROR((LM_ERROR, 00159 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00160 ACE_UNUSED_ARG(addr); 00161 ACE_UNUSED_ARG(len); 00162 ACE_UNUSED_ARG(prot); 00163 return -1; 00164 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::protect | ( | ssize_t | len = -1 , |
|
int | prot = PROT_RDWR | |||
) | [virtual] |
Definition at line 145 of file ZeroCopyAllocator_T.cpp.
00146 {/* no-op */ 00147 ACE_ERROR((LM_ERROR, 00148 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00149 ACE_UNUSED_ARG(len); 00150 ACE_UNUSED_ARG(prot); 00151 return -1; 00152 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::remove | ( | ) | [virtual] |
Definition at line 48 of file ZeroCopyAllocator_T.cpp.
00049 {/* no-op */ 00050 ACE_ERROR((LM_ERROR, 00051 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00052 return -1; 00053 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::sync | ( | void * | addr, | |
size_t | len, | |||
int | flags = MS_SYNC | |||
) | [virtual] |
Definition at line 133 of file ZeroCopyAllocator_T.cpp.
00134 {/* no-op */ 00135 ACE_ERROR((LM_ERROR, 00136 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00137 ACE_UNUSED_ARG(addr); 00138 ACE_UNUSED_ARG(len); 00139 ACE_UNUSED_ARG(flags); 00140 return -1; 00141 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::sync | ( | ssize_t | len = -1 , |
|
int | flags = MS_SYNC | |||
) | [virtual] |
Definition at line 122 of file ZeroCopyAllocator_T.cpp.
00123 {/* no-op */ 00124 ACE_ERROR((LM_ERROR, 00125 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00126 ACE_UNUSED_ARG(len); 00127 ACE_UNUSED_ARG(flags); 00128 return -1; 00129 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::trybind | ( | const char * | name, | |
void *& | pointer | |||
) | [virtual] |
Definition at line 69 of file ZeroCopyAllocator_T.cpp.
00070 {/* no-op */ 00071 ACE_ERROR((LM_ERROR, 00072 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00073 ACE_UNUSED_ARG(name); 00074 ACE_UNUSED_ARG(pointer); 00075 return -1; 00076 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::unbind | ( | const char * | name, | |
void *& | pointer | |||
) | [virtual] |
Definition at line 111 of file ZeroCopyAllocator_T.cpp.
00112 {/* no-op */ 00113 ACE_ERROR((LM_ERROR, 00114 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00115 ACE_UNUSED_ARG(name); 00116 ACE_UNUSED_ARG(pointer); 00117 return -1; 00118 }
int OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::unbind | ( | const char * | name | ) | [virtual] |
Definition at line 101 of file ZeroCopyAllocator_T.cpp.
00102 {/* no-op */ 00103 ACE_ERROR((LM_ERROR, 00104 ACE_TEXT("(%P|%t) %T not supported %a\n"))) ; 00105 ACE_UNUSED_ARG(name); 00106 return -1; 00107 }
bool OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::firstTime_ [private] |
is this the first time this is allocated?
Definition at line 59 of file ZeroCopyAllocator_T.h.
Referenced by OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::malloc().
T OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::pool_[N] [private] |
the pool of allocated memory.
Definition at line 62 of file ZeroCopyAllocator_T.h.
Referenced by OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::free(), OpenDDS::DCPS::FirstTimeFastAllocator< T, N >::malloc(), and OpenDDS::DCPS::FirstTimeFastAllocator< OpenDDS::DCPS::ReceivedDataElement *, DEF_MAX >::pool().