Dynamic application for release of MTK memory

Source: Internet
Author: User

 

Dynamic application for release of MTK memory

1. OslMalloc OslMfree
Allocate memory for a general program to save general data, which is highly efficient and cannot allocate too much memory. Otherwise, the program will be suspended.

  The two functions are directly define the ctrl buffer function to allocate memory and the malloc free function is similar.

 Actually, the memory is allocated and released in a memory pool. The specific implementation is done in ctrl_buff_pool.c.

2. media_get_ext_bufferMedia_free_ext_buffer
Large memory can be allocated, which is an order of magnitude different from OslMalloc. For example, when reading a large file operation, the buffer to be allocated requires this. This is not allocated on the stack and is related to registers. Is to use the space allocated in media, mostly more than 1 m

  Because functions between tasks cannot be called each other, tasks such as MDI use this function when allocating memory. In actual implementation, they send a request buffer message to MOD_SAP to obtain the memory.

3. gui_malloc gui_free
It is generally used to merge layers and save layers. By default, MTK only allocates space for one layer. If you use multiple layers, you have to allocate additional memory.

 This is exactly the same for the implementation of functions and the first pair of functions. It is only available to different modules.

The CTRL buffer mechanism is actually one of the memory pool management mechanisms in the MTK. It feels the same as malloc free, but the number of memory is fixed, for example, buffer 1024 generally only has two or four low-end versions, or even only one. CTRL buffer sets the number, but can be modified.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.