XWOS API
4.0
XWOS C/C++ API参考手册
|
XWOS内存管理:伙伴算法内存块分配器 更多...
#include <xwos/standard.h>
#include <xwos/lib/bclst.h>
#include <xwos/lib/xwbop.h>
#include <xwos/osal/lock/spinlock.h>
#include <xwos/mm/common.h>
结构体 | |
struct | xwmm_bma_orderlist |
阶链表 更多... | |
struct | xwmm_bma_bcb |
块控制块 更多... | |
struct | xwmm_bma |
伙伴算法内存块分配器 更多... | |
宏定义 | |
#define | XWMM_BMA_MAX_ORDER ((xwu8_t)126) |
#define | XWMM_BMA_COMBINED ((xwu8_t)127) |
#define | XWMM_BMA_ORDER_MASK ((xwu8_t)0x7F) |
#define | XWMM_BMA_INUSED ((xwu8_t)0x80) |
#define | XWMM_BMA_RAWOBJ_DEF(name, blkodr) |
定义伙伴算法内存块分配器结构体的RAW内存空间, 用于初始化伙伴算法内存块分配器结构体 | |
函数 | |
xwer_t | xwmm_bma_init (struct xwmm_bma *bma, const char *name, xwptr_t origin, xwsz_t size, xwsz_t blksize, xwsz_t blkodr) |
XWMM API:初始化伙伴算法内存块分配器 | |
xwer_t | xwmm_bma_alloc (struct xwmm_bma *bma, xwsq_t order, void **membuf) |
XWMM API:申请一块连续的内存 | |
xwer_t | xwmm_bma_free (struct xwmm_bma *bma, void *mem) |
XWMM API:释放内存块 | |
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/.
在文件 bma.h 中定义.