同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Memory management is an important procedure in software development, including memory allocation, usage, and reclamation.
Sound memory management approaches and strategies help you improve software performance and reliability.
For user-space development, the OpenHarmony memory management module provides a set of APIs for you to perform memory-related operations, such as memory application, release, remapping, and attribute setting, in addition to standard APIs provided by the C library.
Table 1 Standard APIs in the C library
Details on API differences:
mmap
Function prototype:
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);
Function description: applies for virtual memory.
Parameter description:
NOTE: For details about the implementation differences of mmap between the OS and Linux, see Differences from the Linux Standard Library.
Return values:
munmap
Function prototype:
int munmap(void *addr, size_t length);
Function description: releases virtual memory.
Parameter description:
Indicates the pointer to the start address of the memory region to unmap. |
|
Return values:
mprotect
Function prototype:
int mprotect(void *addr, size_t length, int prot);
Function description: modifies the access permission on a memory region.
Parameter description:
Return values:
mremap
Function prototype:
void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, void new_address);
Function description: remaps the virtual memory address.
Parameter description:
Return values:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。