Lines Matching refs:memory

6memory resources of the system. Memory management involves memory initialization, allocation, and …
10memory management, a type of dynamic memory management, allows memory blocks of any size to be all…
12 **Figure 1** Dynamic memory algorithm for small systems<a name="fig14558185217397"></a>
13 ![](figures/dynamic-memory-algorithm-for-small-systems.png "dynamic-memory-algorithm-for-small-syst…
15 …e lists are used for management based on the size of the free memory block. The free memory blocks…
17memory in the range of \[4, 127\] \(lower part in [Figure 1](#fig14558185217397)\) is equally div…
18 2. The memory greater than 127 bytes is managed in power of two increments. The size of each range…
20memory to a free list. The 40-byte free memory corresponds to the 10th free list in the range of \…
22 [Figure 2](#fig5395115964114) shows the memory management structure.
24 **Figure 2** Dynamic memory management structure for system systems<a name="fig5395115964114"></a…
25 ![](figures/dynamic-memory-management-structure-for-system-systems.png "dynamic-memory-management-s…
29memory pool header contains the memory pool information, bitmap flag array, and free list array. T…
33 …d end node. Each memory node maintains the size and use flag of the memory node and a pointer to t…
40memory management is mainly used to dynamically allocate and manage memory ranges requested by use…
44 The following table describes APIs available for OpenHarmony LiteOS-A heap memory management. For m…
46 **Table 1** Heap memory management APIs
57 …217"><a name="p6485848217"></a><a name="p6485848217"></a>Initializing or deleting a memory pool</p>
61 …name="p94857483110"></a><a name="p94857483110"></a>Initializes a dynamic memory pool of the specif…
66 …48113"><a name="p154851348113"></a><a name="p154851348113"></a>Deletes a memory pool. It is valid …
69 …4"><a name="p19661710214"></a><a name="p19661710214"></a>Allocating or releasing dynamic memory</p>
73 …61715214"></a><a name="p4661715214"></a>Allocates memory of the specified size from the dynamic me…
78 …175218"></a><a name="p1569175218"></a>Releases the memory allocated from the specified dynamic mem…
83memory block of the required size and copies data from the original block to the newly allocated b…
88 …26171714214"></a>Allocates the memory of the specified size and aligned based on the specified byt…
91 …8810129"><a name="p39818810129"></a><a name="p39818810129"></a>Obtaining memory pool information</…
95 …2"></a><a name="p129820881212"></a>Obtains the total size of the specified dynamic memory pool.</p>
100 …9124"></a><a name="p1598889124"></a>Obtains the total memory usage of the specified dynamic memory
105memory structure information of the specified memory pool, including the free memory, used memory,…
110memory pools in the system, including the start address, size, total free memory, used memory, max…
113 …319"><a name="p1058973361319"></a><a name="p1058973361319"></a>Obtaining memory block information<…
117 …me="p437618158141"></a>Prints the size and number of free memory blocks in the specified memory po…
120 …513"><a name="p13599202711513"></a><a name="p13599202711513"></a>Checking memory pool integrity</p>
124 …53"></a><a name="p15644611153"></a>Checks the integrity of the specified memory pool. It is valid …
131 >- The dynamic memory module manages memory through control block structures, which consume extra…
132 …s consume extra memory for memory alignment, which may cause memory loss. When the memory used for…
136 The typical development process of dynamic memory is as follows:
138 1. Call the **LOS\_MemInit** API to initialize a memory pool.
140memory pool is initialized, a memory pool control header and end node will be generated, and the r…
143 1. Call the **LOS\_MemAlloc** API to allocate dynamic memory of any size.
145memory pool has free memory blocks greater than the requested size. If yes, the system allocates a…
148 1. Call the **LOS\_MemFree** API to release dynamic memory.
150 …released memory block can be reused. When **LOS\_MemFree** is called, the memory block will be r…
157 1. Initialize a dynamic memory pool.
158 2. Allocate a memory block from the dynamic memory pool.
159 3. Store a piece of data in the memory block.
160 4. Print the data in the memory block.
161 5. Release the memory block.
176 /* Initialize the memory pool. */
185 /* Allocate memory.*/
197 /* Release memory.*/