Malloc and free threadsafe?
Posted: Thu Jul 11, 2019 9:48 am
I want to access I2C functionality from multiple tasks. My current plan is to have one task communicate with the I2C driver (the handler task) and pass the i2c_cmd_handle_t s which are created by different tasks to the handler task. Once the handler is done it should free the i2c_cmd_handle_t s.
So my question is:
Can one task malloc something and another task free that allocated memory?
Do I have to protect malloc and free from being accessed by multiple tasks at the same time.
I read through https://docs.espressif.com/projects/esp ... alloc.html but it didn't answer my questions.
So my question is:
Can one task malloc something and another task free that allocated memory?
Do I have to protect malloc and free from being accessed by multiple tasks at the same time.
I read through https://docs.espressif.com/projects/esp ... alloc.html but it didn't answer my questions.