Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RE: Issue in dynamic memory allocation

$
0
0
To create a byte pool :-    uint8_t          g_tx_byte_pool_area[4 * 1024];    TX_BYTE_POOL     g_tx_byte_pool;    UINT status;    status = tx_byte_pool_create(&g_tx_byte_pool, (CHAR *)"my_byte_pool", g_tx_byte_pool_area, sizeof(g_tx_byte_pool_area));    if (status != TX_SUCCESS)    {        while(1);    } Then to allocate from that byte pool :-    UCHAR  * memory_ptr;    status = tx_byte_allocate( &g_tx_byte_pool, (void **)&memory_ptr, 512, TX_NO_WAIT);    if (status != TX_SUCCESS)    {        while(1);    }

Viewing all articles
Browse latest Browse all 59170

Trending Articles