Changeset 45190

Timestamp:
May 7, 2008, 7:08:01 AM (14 years ago)
Author:
xushiwei
Message:
  1. Update GC Allocator specification. The following is minimum specification for GC Allocator:
typedef void (*DestructorType)(void* data);
 
concept GCAllocator
{
    // Allocate memory without given a cleanup function
    void* allocate(size_t cb);
 
    // Allocate unmanaged memory with a cleanup function
    void* unmanaged_alloc(size_t cb, DestructorType fn);

    // Commit unmanaged memory to be managed.
    void* manage(void* p, destructor_t fn);
 
    // Deprecated: allocate memory with a cleanup function
    void* allocate(size_t cb, DestructorType fn) {
       return manage(unmanaged_alloc(cb, fn), fn);
    }

    // Cleanup and deallocate all allocated memory by this GC Allocator
    void clear();
 
    // Swap two GCAllocator instances
    void swap(GCAllocator& o);
};
  1. testExceptionSemantics
(No files)

Note: See TracChangeset for help on using the changeset viewer.