Embedded memory management method and device based on global byte array

A byte array, memory management technology, applied in the field of embedded technology and the Internet of Things, can solve the problem of high complexity and redundancy

Inactive Publication Date: 2021-04-20
SICHUAN JIUZHOU ELECTRIC GROUP
View PDF7 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In order to solve the technical problems of the existing static allocation method based on global variables such as high complexity and redundancy, the present invention provides an embedded memory management device based on global byte ...

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
  • Embedded memory management method and device based on global byte array
  • Embedded memory management method and device based on global byte array
  • Embedded memory management method and device based on global byte array

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0041] Compared with the existing static allocation method based on global variables, it is difficult to use complex data structures in software design, such as linked lists and hash tables, and the complexity and redundancy of software design and implementation are high, and the readability is relatively low. In order to solve the problem of poor quality, this embodiment provides an embedded memory management device based on global byte arrays, which implements efficient and reliable memory management on the basis of global byte arrays, and supports complex data structures in embedded software design usage of.

[0042] The device of this embodiment includes a memory pool and a memory manager;

[0043] The memory pool is created by defining a global byte array in the embedded system, and the memory pool is divided into multiple fixed-size memory blocks;

[0044] The memory manager includes a memory pool usage status and a one-way linked list. The memory pool usage status is u...

Embodiment 2

[0072] This embodiment performs memory dynamic application management based on the management method provided in the above-mentioned embodiment 1, specifically as Figure 5 As shown, the memory dynamic application management process in this embodiment specifically includes:

[0073] Step S11, judging whether there are free memory blocks according to the number of free memory blocks in the memory pool usage state, if the free number is greater than zero, there is available memory space, and step S12 is executed, if the free number is equal to zero, there is no available memory space, and a null value is returned directly.

[0074] Step S12, temporarily storing the first address of the first node of the one-way linked list, and pointing the head of the one-way linked list to the next node.

[0075] Step S13, updating the usage status of the memory pool: subtracting one from the idle number of the usage status of the memory pool, and adding one to the used number;

[0076] Step ...

Embodiment 3

[0079] This embodiment performs memory dynamic release management based on the management method provided in the above-mentioned embodiment 1, specifically as Figure 7 As shown, the memory dynamic release management process in this embodiment specifically includes:

[0080] Step S21, all the memory space of the memory block that needs to be released is set to zero, so that it can be directly used next time;

[0081] Step S22, adding one to the idle number of the memory pool usage state, and decrementing the used number by one;

[0082] Step S23, insert the memory block to be released into the first node position of the one-way linked list.

[0083] Specific as Figure 8 The schematic diagram of the state after one dynamic release of memory is shown (among them, the block filled with squares represents the used memory block). In this embodiment, it is assumed that the first memory block is released for the first time, and the corresponding one-way linked list The subscript ...

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 an embedded memory management method and device based on a global byte array. The device comprises a memory pool and a memory manager, wherein the memory pool is created by defining a global byte array in an embedded system, and the memory pool is divided into a plurality of memory blocks with fixed sizes; wherein the memory manager comprises a memory pool use state and a one-way linked list, the memory pool use state is used for indicating the use condition of memory blocks, and the one-way linked list is used for hooking idle memory blocks in the memory pool; and the memory manager is used for providing dynamic memory management for the outside. According to the method, efficient and reliable memory management is realized on the basis of the global byte array, and the use of a complex data structure in embedded software design is supported.

Description

technical field [0001] The invention belongs to the technical fields of embedded technology and the Internet of Things, and in particular relates to an embedded memory management method and device based on a global byte array. Background technique [0002] With the rapid development of intelligent technology and Internet of Things technology, various devices are interconnected, embedded devices begin to undertake more and more functions, more and more modules need to be integrated, and the scale and complexity of embedded software development are also increasing. come higher. In order to cope with the high complexity of software functions, currently embedded software is developed based on embedded operating systems (such as FreeRTOS, DSP BIOS, etc.) to achieve various concurrent functions, so the memory management of embedded operating systems has become An important aspect in development, the real-time and stability of memory management is crucial to the performance impact...

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
IPC IPC(8): G06F9/50
Inventor 任文龙刘嵩义温奎罗勇
Owner SICHUAN JIUZHOU ELECTRIC GROUP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products