Memory Management: Examples

HomeOverviewHow Do I

This article describes how MFC performs frame allocations and heap allocations for each of the three typical kinds of memory allocations:

Allocation of an Array of Bytes

To allocate an array of bytes on the frame

To allocate an array of bytes (or any primitive data type) on the heap

To deallocate the arrays from the heap

Allocation of a Data Structure

To allocate a data structure on the frame

To allocate data structures on the heap

Allocation of an Object

To allocate an object on the frame

To allocate an object on the heap