Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Active Publication Date: 2022-05-27
ACTIONS ZHUHAI TECH CO
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Therefore, if the static allocation method is used, dozens of KB of RAM will be permanently occupied by the Bluetooth controller, and the memory waste is serious.
[0004] Another memory allocation method is to apply for and release memory through the unified memory management interface of the system, but the memory managed by the system is relatively large, and the time for memory application and release is relatively uncontrollable, and it may take several us to hundreds of us time
In addition, frequent application and release will also cause a large amount of memory fragmentation in the system, so it is not feasible to use the unified memory management interface of the system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A memory allocation method and device
  • A memory allocation method and device
  • A memory allocation method and device

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a memory allocation method and device. In the method, at least one block linked list for linking allocated memory block blocks is constructed for a memory; An idle node linked list of idle nodes in the block; when a memory allocation request is received, allocate memory according to the at least one block linked list and the at least one idle node linked list. The invention can meet the requirements of memory allocation frequency and inconsistent memory size, more flexible memory allocation, occupies very little management space, reduces memory waste, and can quickly find and allocate suitable space when allocating space.

Description

technical field [0001] The present invention relates to the technical field of memory allocation, and in particular, to a memory allocation method and device. Background technique [0002] At present, the memory allocation method of a device generally adopts a static allocation method, that is, a fixed number of memory spaces of a fixed size are allocated in advance for different memory occupation types. For example, allocate 6 pieces of memory with a fixed size of 1024 bytes for the asynchronous connectionless link ACL (Asynchronous Connectionless Link), and then use a singly linked list to string them together. [0003] This method is the fastest to allocate and free, but due to the allocation of fixed-size memory space, there is a large waste of memory usage. Especially for small embedded systems, there are only one or two hundred KB RAM available in total. Therefore, if the static allocation method is used, dozens of KB of RAM will be permanently occupied by the Blueto...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F12/02
CPCG06F12/0292G06F12/023
Inventor 陈金宏
Owner ACTIONS ZHUHAI TECH CO