Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Struct default_user_allocator_new_delete

boost::default_user_allocator_new_delete — Allocator used as the default template parameter for a UserAllocator template parameter. Uses new and delete.

Synopsis

// In header: <boost/pool/pool.hpp>


struct default_user_allocator_new_delete {
  // types
  typedef std::size_t    size_type;        // An unsigned integral type that can represent the size of the largest object to be allocated. 
  typedef std::ptrdiff_t difference_type;  // A signed integral type that can represent the difference of any two pointers. 

  // public static functions
  static char * malloc(const size_type);
  static void free(char *const);
};

Description

default_user_allocator_new_delete public static functions

  1. static char * malloc(const size_type bytes);

    Attempts to allocate n bytes from the system. Returns 0 if out-of-memory

  2. static void free(char *const block);

    Attempts to de-allocate block.

    Requires:

    Block must have been previously returned from a call to UserAllocator::malloc.


PrevUpHomeNext