内存
此模块包含用于动态内存分配的平台抽象。
摘要
函数
otPlatCAlloc
void * otPlatCAlloc(
size_t aNum,
size_t aSize
)
动态分配新内存。
在支持它的平台上,只应重定向到 calloc。对于不支持 calloc 的对象,应支持相同的功能:
{/0} 已分配的内存被填充为零值字节。”
这是 OPENThread_CONFIG_HEAP_EXTERNAL_ENABLE 所需的函数。
详情 |
参数 |
[in] aNum
|
要分配的块数量
|
[in] aSize
|
要分配的每个块的大小
|
|
返回值 |
void*
|
指向已分配内存前端的指针
|
NULL
|
未能分配请求的内存。
|
|
otPlatFree
void otPlatFree(
void *aPtr
)
释放动态分配的内存。
这是 OPENThread_CONFIG_HEAP_EXTERNAL_ENABLE 所需的函数。
详情 |
参数 |
[in] aPtr
|
内存块要释放的指针。指针可能为 NULL。
|
|
资源
OpenThread API 参考主题源自源代码,可在 GitHub 上找到。
如需了解详情或为我们的文档做贡献,请参阅资源。
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Thread is a registered trademark of the Thread Group, Inc.
Last updated 2021-12-30 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]