The _free_box function returns a memory block, which was allocated using _alloc_box or _calloc_box, back to the memory pool where it was obtained from. The box argument specifies the address of the memory block to be freed. The box_mem argument specifies the start address of the memory pool where the block was obtained from. The _free_box function is in the RL-RTX library. The prototype is defined in rtl.h. Note - If you return the memory block to a memory pool that did not provide the memory block, serious memory errors might occur.
- The _free_box function is reentrant and thread-safe. You can call it from the main function and from an IRQ interrupt function with no restriction.
|