6 #ifndef OPENDDS_DCPS_ZEROCOPYALLOCATOR_T_H 7 #define OPENDDS_DCPS_ZEROCOPYALLOCATOR_T_H 9 #include <ace/config-macros.h> 10 #ifndef ACE_LACKS_PRAGMA_ONCE 28 template <
class T, std::
size_t N>
32 virtual void *
malloc(
size_t nbytes);
33 virtual void free(
void *ptr);
36 virtual void *
calloc(
size_t nbytes,
char initial_value =
'\0');
37 virtual void *
calloc(
size_t n_elem,
size_t elem_size,
char initial_value =
'\0');
39 virtual int bind(
const char *
name,
void *pointer,
int duplicates = 0);
40 virtual int trybind(
const char *name,
void *&pointer);
41 virtual int find(
const char *name,
void *&pointer);
42 virtual int find(
const char *name);
43 virtual int unbind(
const char *name);
44 virtual int unbind(
const char *name,
void *&pointer);
46 virtual int sync(
void *addr,
size_t len,
int flags =
MS_SYNC);
49 #if defined (ACE_HAS_MALLOC_STATS) 50 virtual void print_stats()
const;
52 virtual void dump()
const;
71 #if defined (__ACE_INLINE__) 75 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 79 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 80 #pragma implementation ("ZeroCopyAllocator_T.cpp")
virtual int bind(const char *name, void *pointer, int duplicates=0)
T pool_[N]
the pool of allocated memory.
virtual int sync(ssize_t len=-1, int flags=MS_SYNC)
virtual int unbind(const char *name)
bool firstTime_
is this the first time this is allocated?
virtual void * calloc(size_t nbytes, char initial_value='\0')
These methods are no-ops.
virtual void free(void *ptr)
virtual int protect(ssize_t len=-1, int prot=PROT_RDWR)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual int trybind(const char *name, void *&pointer)
virtual void dump() const
The Internal API and Implementation of OpenDDS.
virtual int find(const char *name, void *&pointer)
virtual void * malloc(size_t nbytes)