12 | | * For the '''malloc()''' function, the cluster selection is implicit: the (x,y) coordinate are defined by the coordinates of the processor running the calling task. |
13 | | * For the '''remote_malloc()''' function, the cluster selection is explicit: the (x,y) coordinates are arguments defined by the calling task |
| 12 | The malloc() and free() functions below have the same semantic as the standard UNIX functions. |
| 13 | |
| 14 | == cluster selection == |
| 15 | |
| 16 | Using the '''(x,y)''' arguments (as in the remote_malloc() function below), the user application can explicitely select the allocator in cluster(x,y). |
| 17 | If these arguments (x,y) are not defined, (as in the malloc() function below), the cluster is implicitely defined by the (x,y) coordinate of the processor running the calling task. |
| 18 | If there is no heap(x,y) defined in the selected cluster, or if there is no more space in the selected heap(x,y) segment, a NULL pointer is returned. |
| 19 | |
| 20 | == alignment == |
| 21 | |
| 22 | Using the '''align''' arguments, the user application can require the selected allocator to return a virtual address aligned on a power of 2 (1 << align). |
| 23 | If the align argument value is larger than 31, a NULL pointer is returned. |
17 | | * |
| 27 | * '''void * malloc( unsigned int size ) |
| 28 | * '''void * malloc_aligned( unsigned int size, unsigned int align ) |
| 29 | * '''void * remote_malloc( unsigned int size, unsigned int x, unsigned int y ) |
| 30 | * '''void * remote_malloc_aligned( unsigned int size, unsigned int align, unsigned int x, unsigned int y ) |
| 31 | * '''void free( void* ptr ) |
| 32 | |
| 33 | == WARNING == |
| 34 | In the present implementation, the free() function cannot be used with the remote_malloc() and remote |