NAME

ACE_Local_Memory_Pool - Make a memory pool that is based on C++ new/delete. This is useful for integrating existing components that use new/delete into the ACE Malloc scheme...

SYNOPSIS

#include <ace/ACE_Memory_Pool.h>

class ACE_Local_Memory_Pool { public: typedef ACE_Local_Memory_Pool_Options OPTIONS; ACE_Local_Memory_Pool ( LPCTSTR backing_store_name = 0, const OPTIONS *options = 0 ); virtual ~ACE_Local_Memory_Pool (void); virtual void *init_acquire ( size_t nbytes, size_t &rounded_bytes, int &first_time ); virtual void *acquire (size_t nbytes, size_t &rounded_bytes); virtual int release (void); 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 (void) const; ACE_ALLOC_HOOK_DECLARE; protected: ACE_Unbounded_Set<char *> allocated_chunks_; virtual size_t round_up (size_t nbytes); };

PUBLIC MEMBERS

typedef ACE_Local_Memory_Pool_Options OPTIONS;

ACE_Local_Memory_Pool (
    LPCTSTR backing_store_name = 0,
    const OPTIONS *options = 0
    );

virtual ~ACE_Local_Memory_Pool (void);

virtual void *init_acquire (
    size_t nbytes,
    size_t &rounded_bytes,
    int &first_time
    );

virtual void *acquire (size_t nbytes, size_t &rounded_bytes);

virtual int release (void);

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 (void) const;

ACE_ALLOC_HOOK_DECLARE;

PROTECTED MEMBERS

ACE_Unbounded_Set<char *> allocated_chunks_;

virtual size_t round_up (size_t nbytes);

AUTHOR

Doug Schmidt and Prashant Jain

LIBRARY

ace