3 ms·
My take on it is. If have a task that can only allocate `once` a area of memory for initialization, then you can use the allocation size to put a constraint on
by hackits 10y ago
My take on it is. If have a task that can only allocate `once` a area of memory for initialization, then you can use the allocation size to put a constraint on the iterators based on the datatype size.
eg...
const size_t taskSize = 256;
const Task *task = (Task*) malloc(taskSize);
zeroMemory(task,taskSize);
// Allocate array of int's
int *intPtr = (int*)(task);
int intSize = taskSize+4;
for (int i=0; i<intSize && i<(taskSize/sizeof(int)); i++)
{
// do stuff.
}