diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-911CD800-2D1B-5D7B-A67C-66E01F91062C.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-911CD800-2D1B-5D7B-A67C-66E01F91062C.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,39 @@ + + + + + +HeapsThe main thread of a process has a memory chunk that contains the +thread's heap. A program's request for memory is allocated from this heap. +

Each thread has a chunk which contains that thread's program stack. For +the main thread of a process, this chunk also contains the thread's heap. +A program's request for memory is allocated from this heap. For example, a +code fragment such as:

+CArrayFixFlat<...>* fixflat; +... +fixflat = new (ELeave) CArrayFixFlat<...>(3); +

causes a portion of memory to be allocated from the heap and its address +returned to the caller. Memory from the heap must be explicitly requested +and, importantly, explicitly freed by the program.

+

If a process creates additional threads, then a new chunk is created for +each new thread. Each chunk contains the thread's stack; if a new thread is +not sharing an existing heap, then the chunk also contains a new heap.

+

When a new thread is created, either:

+ +

A thread gets the handle to its heap by calling User::Heap().

+

See Address Space +and Process for more background on chunks and heaps.

+
\ No newline at end of file