Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Welcome Guest | Log In | Register | Benefits
Channels ▼
RSS

Avoiding the Visual C++ Runtime Library


February 2003/Avoiding the Visual C++ Runtime Library

Listing 11 Implementing per-class allocation

class HeapBasedClass
{
    ...

public:
    void *operator new(size_t si)
    {
        return ::HeapAlloc(::GetProcessHeap(), 0, si);
    }
    void operator delete (void *pv) throw()
    {
        ::HeapFree(::GetProcessHeap(), 0, pv);
    }
};



Related Reading


More Insights