Heap attribute

Top  Previous  Next

Some editions of Diamond have optional modules that can be accessed from any task on a particular processor. These may require dynamically-allocated memory that is taken from a processor-wide heap. The heap attribute of a PROCESSOR statement is used to allocate memory to this heap:

 

PROCESSOR node SMT361 HEAP=4M

 

Dragons003You should distinguish between the heap attribute of the TASK statement, which is used to create space for memory allocation by malloc ( and calloc and memalign), and this PROCESSOR heap that you cannot access directly. If you are not using a module that explicitly requires a processor heap, giving this attribute will simply waste space.