Hi All
Is there any special reason to dynamically allocate a buffer which is used only in a function ?
I can see for instance in TI BLE examples:
void myFunction(void)
{
uint8 *temp_buf = osal_mem_alloc(numBytes);
(void)NPI_ReadTransport(temp_buf, numBytes);
...
osal_mem_free(temp_buf);
}
Can't this be replaced by a static allocation if temp_buf is used only inside the function ?
Something like:
uint8 temp_buf[128]; (void)NPI_ReadTransport(&temp_buf[0], numBytes);
Since I'm sure numBytes is lower or equal to 128.
Thanks
Jerome