A memory allocation method and device
A memory allocation and memory technology, applied in memory address/allocation/relocation, memory systems, instruments, etc., can solve problems such as large memory fragmentation, RAM occupation, memory waste, etc., to reduce memory waste, flexible memory allocation, less The effect of managing space
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0069] The Bluetooth controller has the following requirements for the use of memory: In some scenarios, the memory application and release are very frequent, such as the Bluetooth connection process, Bluetooth call or Bluetooth song playback process, etc.; the size of memory usage varies, and the minimum may apply for a byte Memory, a maximum of 1021 bytes of memory may be applied; the speed of memory allocation and release is relatively high, and it is generally required to complete the application or release of memory within 20us under the 24M CPU frequency.
[0070] In order to meet the memory usage requirements of devices such as a Bluetooth controller having the above-mentioned memory usage characteristics, an embodiment of the present invention provides a memory allocation method, such as figure 1 As shown, the method includes:
[0071] Step 101, construct at least one block linked list for linking the allocated memory block block for a memory;
[0072] It should be no...
Embodiment 2
[0195] An embodiment of the present invention provides a memory allocation device, including a processor and a memory, where the processor is used for:
[0196] Construct at least one block linked list for linking the allocated memory block blocks for a memory;
[0197] On the basis of the block linked list, construct at least one idle node linked list for linking idle nodes in the block;
[0198] When a memory allocation request is received, memory is allocated according to the at least one block linked list and the at least one free node linked list.
[0199] Optionally, each described block linked list corresponds to a head pointer, which is used to point to the first allocated block in the corresponding block linked list; the above-mentioned processor is specifically used for:
[0200] Each block allocated from the memory is connected to the corresponding block linked list, the block is divided into at least one node, and each block has a block pointer pointing to the nex...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


