Synopsis
void *ctl_net_mem_alloc_xmit(size_t byteSize,
                             CTL_TIME_t toTicks);
Description

ctl_net_mem_alloc_xmit is a wrapper around the alloc_xmit member of the singleton instance of the network memory manager (see CTL_NET_MEM_DRIVER_t and ctl_net_mem_alloc_fn_t).

The network library memory manager attempts to use its entire heap to satisfy this request. Buffers allocated with this routine should be freed using ctl_net_mem_free.

The network memory manager driver returns a word-aligned buffer of at least byteSize bytes when successful, null for fail. If toTicks is non-zero and the allocation initially fails, ctl_net_mem_alloc_xmit blocks in the hope that another task or ISR will call ctl_net_mem_free in the interim, giving the network memory manager adequate resources to perform the allocation.

Thread Safety

Even with toTicks set to zero, ctl_net_mem_alloc_xmit is not safe to call from an interrupt service routine.

See Also

ctl_net_mem_alloc_data, ctl_net_mem_free, CTL_NET_MEM_DRIVER_t