unsigned *ctl_memory_area_allocate(CTL_MEMORY_AREA_t *memory_area);

ctl_memory_area_allocate allocates a block from the initialized memory area memory_area. ctl_memory_area_allocate returns a block of the size specified in the call to ctl_memory_area_init or zero if no blocks are available.

ctl_memory_area_allocate executes in constant time and is very fast. You can call ctl_memory_area_allocate from an interrupt service routine, from a task, or from initialization code.