Provides low-level functionality by which an EPOC process can access and manipulate memory areas.
Most client programs do not need to use this functionality directly. They are used by programs that are explicitly concerned about sharing memory areas between threads within a process, or between processes.
A chunk is a region of RAM mapped into contiguous linear addresses. The address space of a process when it is created consists of one to three chunks:
The stack/heap chunk; this contains the stack and the heap used by the main thread of the process. This chunk always exists.
The code chunk: this exists only if the process is loaded into RAM (i.e. it is not ROM resident).
The data chunk: this exists only if the process has static data.
A program can create additional chunks. A global chunk can be accessed by other processes, and so allows large amounts of memory to be shared.
The chunk interface is provided by RChunk
.
TFindChunk
is used for finding a global
chunk created by another process.
A heap is used for explicit dynamic allocation of memory. EPOC
defines C++'s new
operator to create objects on the current
thread's heap.
Heaps may be:
monitored for memory leaks: this happens automatically for GUI applications
shared between threads within a process
accessed and manipulated at the cell level
The heap interface is provided by RHeap
.
Where the heap in question is the current thread's heap, it is more convenient
to use the equivalent functions provided by the System Static Functions API
User
class.
The System Static Functions API also provides macros that conveniently wrap calls for monitoring heap usage for memory leaks.