|
XWOS API
4.0
XWOS C/C++ API参考手册
|
XWOS内存管理:内存池:对象缓存 更多...
#include <xwos/standard.h>#include <xwos/lib/xwbop.h>#include <xwos/lib/xwaop.h>#include <xwos/lib/bclst.h>#include <xwos/lib/lfq.h>#include <xwos/osal/lock/seqlock.h>#include <xwos/mm/common.h>#include <xwos/mm/mempool/page.h>#include <xwos/mm/mempool/objcache.h>
宏定义 | |
| #define | xwmm_mempoollogf(lv, thd, fmt, ...) |
XWOS内存管理:内存池:对象缓存
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
在文件 objcache.c 中定义.
| #define xwmm_mempoollogf | ( | lv, | |
| thd, | |||
| fmt, | |||
| ... | |||
| ) |
< 调试日志开关
在文件 objcache.c 第 28 行定义.
|
static |
释放空闲页
| [in] | oc | 对象缓存的指针 |
| [in] | nr | 期望释放的数量 |
在文件 objcache.c 第 160 行定义.


|
static |
i_allocator接口函数:释放内存
| [in] | this | this指针(页分配器) |
| [in] | mem | 内存的首地址 |
| XWOK | 没有错误 |
| -ENOMEM | 内存不足 |
在文件 objcache.c 第 430 行定义.


i_allocator接口函数:申请内存
| [in] | this | this指针(页分配器) |
| [in] | size | 申请的大小 |
| [out] | membuf | 指向缓冲区的指针,通过此缓冲区返回申请到的内存的首地址 |
| XWOK | 没有错误 |
| -ENOMEM | 内存不足 |
<Size error
<No error
在文件 objcache.c 第 400 行定义.


|
static |
获取一页,准备从页内存中分配对象
| [in] | oc | 对象缓存的指针 |
| [out] | pgbuf | 指向缓冲区的指针,通过此缓冲区返回页控制块的指针 |
| XWOK | 没有错误 |
| -ENOMEM | 内存不足 |
<No error
在文件 objcache.c 第 225 行定义.


|
static |
初始化新页
| [in] | oc | 对象缓存的指针 |
| [in] | pg | 页控制块的指针 |
在文件 objcache.c 第 115 行定义.


|
static |
减少页的引用计数
| [in] | oc | 对象缓存的指针 |
| [in] | pg | 页控制块的指针 |
| XWOK | 没有错误 |
| <0 | 失败 |
< 报告BUG
< 当条件x成立时报告BUG
在文件 objcache.c 第 197 行定义.

