Memory Management APIs Provided by the Native Language
The native language (C/C++) provides the malloc, free, memcpy, memset, new, and delete APIs for memory management. You can manage and control the lifecycle of memory allocated by using these APIs. If the memory to be allocated is less than 256 KB, memory management APIs provided by the native language and those provided by the Matrix module show similar performance. Therefore, you are advised to use a memory management API provided by the native language to simplify programming.
// Use malloc to alloc buffer unsigned char* inbuf = (unsigned char*)malloc( fileLen ); // free buffer free(inbuf); inbuf = nullptr;
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot