Bird
0
0

Which of the following is the correct syntax to free memory allocated by pvPortMalloc?

easy📝 Syntax Q12 of 15
FreeRTOS - Memory Management
Which of the following is the correct syntax to free memory allocated by pvPortMalloc?
AvPortFree(pointer);
BpvPortMalloc(pointer);
Cfree(pointer);
DvPortMalloc(pointer);
Step-by-Step Solution
Solution:
  1. Step 1: Identify the function to free memory

    Memory allocated by pvPortMalloc must be freed using vPortFree to avoid memory leaks.
  2. Step 2: Check syntax correctness

    The correct syntax is vPortFree(pointer);. Other options either allocate memory or use standard C free, which is not recommended in FreeRTOS.
  3. Final Answer:

    vPortFree(pointer); -> Option A
  4. Quick Check:

    Free memory with vPortFree [OK]
Quick Trick: Use vPortFree to release memory allocated by pvPortMalloc [OK]
Common Mistakes:
  • Using free() instead of vPortFree()
  • Calling pvPortMalloc to free memory
  • Incorrect function names like vPortMalloc

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes