### Types of Memory

There are different types of memory:

- Regular
- Shared
- Tiled

Regular Memory
Most programs use regular memory. This is the type provided by the default run-time heap.

Shared Memory
Heaps of shared memory can be shared between processes or applications. If you want other processes to use the heap you have created, you must pass them the heap handle and give them access to the heap.

Tiled Memory (OS/2)
Tiled memory is guaranteed not to cross 64K boundaries (as long as the object being allocated is less than 64K), so it is appropriate for objects that may be accessed by 16-bit code.

Note the following characteristics of tiled memory:

- When you use the /Gt compiler option, the regular versions of the memory management functions (that use the default heap) are mapped to tiled memory management functions so that they also return tiled memory.
- If you parenthesize the function calls, they are not mapped to the tiled versions and therefore return regular memory. However, if you replace the default run-time heap with your own tiled heap, all regular memory management functions will use the new default heap of tiled memory, regardless of whether the calls are parenthesized.
- There are no tiled versions of the heap-specific functions; to use tiled memory, create a tiled heap and specify it when you call the functions.

Specify your memory type
Make sure you specify the memory type when you get the initial block for your heap, when you create the heap, and when you add to your heap (with _uaddmem or your getmore_fn function). For example, if you use tiled memory, you need to specify the /Gt compiler option to ensure your objects are correctly aligned.

Memory Management Functions
Manage Memory with Multiple Heaps

Change the Default Heap

Differentiating between the Memory Management Functions
Summary of Compiler Options