NAME

ACE_Allocator_Adapter - This class is an Adapter that allows the ACE_Allocator to use the Malloc class below.

SYNOPSIS


#include <ace/Malloc_T.h>


template<class MALLOC>
class ACE_Allocator_Adapter : public ACE_Allocator
{
  public:
    typedef MALLOC ALLOCATOR;
    ACE_Allocator_Adapter (const char *pool_name = ACE_DEFAULT_MUTEX);
    ACE_Allocator_Adapter (
        const char *pool_name,
        const char *lock_name
        );
    virtual void *malloc (size_t nbytes);
    virtual void *calloc (size_t nbytes, char initial_value = '  ');
    virtual void free (void *ptr);
    virtual int remove (void);
    int bind (const char *name, void *pointer, int duplicates = 0);
    int trybind (const char *name, void *&pointer);
    int find (const char *name, void *&pointer);
    int find (const char *name);
    int unbind (const char *name);
    int unbind (const char *name, void *&pointer);
    int sync (ssize_t len = -1, int flags = MS_SYNC);
    int sync (void *addr, size_t len, int flags = MS_SYNC);
    int protect (ssize_t len = -1, int prot = PROT_RDWR);
    int protect (void *addr, size_t len, int prot = PROT_RDWR);
    ALLOCATOR &allocator (void);
    virtual void dump (void) const;
  private:
    ALLOCATOR allocator_;
};

Initialization.

ACE_Allocator_Adapter (const char *pool_name = ACE_DEFAULT_MUTEX);
ACE_Allocator_Adapter (const char *pool_name, const char *lock_name);

Memory Management

virtual void *malloc (size_t nbytes);
virtual void *calloc (size_t nbytes, char initial_value = '  ');
virtual void free (void *ptr);
virtual int remove (void);

Map manager like functions

int bind (const char *name, void *pointer, int duplicates = 0);
int trybind (const char *name, void *&pointer);
int find (const char *name, void *&pointer);
int find (const char *name);
int unbind (const char *name);
int unbind (const char *name, void *&pointer);

Protection and

sync" (i.e., flushing data to backing store)."
int sync (ssize_t len = -1, int flags = MS_SYNC);
int sync (void *addr, size_t len, int flags = MS_SYNC);
int protect (ssize_t len = -1, int prot = PROT_RDWR);
int protect (void *addr, size_t len, int prot = PROT_RDWR);
ALLOCATOR &allocator (void);
virtual void dump (void) const;

AUTHOR

Doug Schmidt and Irfan Pyarali

LIBRARY

ace