580db0315946a9be782c332b66e843acc54d1eec
7 // HACK HACK! This must be placed in another global ATL header!!
8 // Placement new operator
9 void *operator new (size_t, void *buf
)
17 //__interface __declspec(uuid("654F7EF5-CFDF-4df9-A450-6C6A13C622C0"))
21 virtual ~IAtlMemMgr() {};
23 virtual _Ret_maybenull_
_Post_writable_byte_size_(SizeBytes
) void* Allocate(
28 _Inout_opt_
void* Buffer
31 virtual _Ret_maybenull_
_Post_writable_byte_size_(SizeBytes
) void* Reallocate(
32 _Inout_updates_bytes_opt_(SizeBytes
) void* Buffer
,
36 virtual size_t GetSize(
41 class CWin32Heap
: public IAtlMemMgr
52 CWin32Heap(_In_ HANDLE hHeap
) :
55 ATLASSERT(hHeap
!= NULL
);
64 _Ret_maybenull_
_Post_writable_byte_size_(SizeBytes
) virtual void* Allocate(
68 return ::HeapAlloc(m_hHeap
, 0, SizeBytes
);
77 if (!::HeapFree(m_hHeap
, 0, Buffer
))
82 _Ret_maybenull_
_Post_writable_byte_size_(SizeBytes
) virtual void* Reallocate(
83 _In_opt_
void* Buffer
,
95 return Allocate(SizeBytes
);
98 return ::HeapReAlloc(m_hHeap
, 0, Buffer
, SizeBytes
);
101 virtual size_t GetSize(
105 return ::HeapSize(m_hHeap
, 0, Buffer
);