XWOS API
4.0
XWOS C/C++ API参考手册
|
XWOS内存管理:内存池:页分配器 更多...
#include <xwos/standard.h>
#include <xwos/mm/common.h>
#include <xwos/mm/mempool/page.h>
#include <xwos/mm/mempool/objcache.h>
结构体 | |
struct | xwmm_mempool |
内存池 更多... | |
宏定义 | |
#define | XWMM_MEMPOOL_PAGE_SIZE (4096U) |
#define | XWMM_MEMPOOL_OC_8_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_16_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_32_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_64_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_96_PAGE_ODR (1U) |
#define | XWMM_MEMPOOL_OC_128_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_160_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_192_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_256_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_320_PAGE_ODR (1U) |
#define | XWMM_MEMPOOL_OC_384_PAGE_ODR (1U) |
#define | XWMM_MEMPOOL_OC_512_PAGE_ODR (1U) |
#define | XWMM_MEMPOOL_OC_768_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_1024_PAGE_ODR (0U) |
#define | XWMM_MEMPOOL_OC_2048_PAGE_ODR (1U) |
#define | XWMM_MEMPOOL_RAWOBJ_DEF(name, pgodr) |
定义内存池结构体的RAW内存空间,用于初始化内存池结构体 | |
函数 | |
xwer_t | xwmm_mempool_init (struct xwmm_mempool *mp, const char *name, xwptr_t origin, xwsz_t size, xwsz_t pgodr, xwsz_t pre, void **membuf) |
XWMM API:初始化内存池 | |
xwer_t | xwmm_mempool_malloc (struct xwmm_mempool *mp, xwsz_t size, void **membuf) |
XWMM API:从内存池中申请内存 | |
xwer_t | xwmm_mempool_free (struct xwmm_mempool *mp, void *mem) |
XWMM API:释放内存 | |
xwer_t | xwmm_mempool_realloc (struct xwmm_mempool *mp, xwsz_t size, void **membuf) |
XWMM API:调整内存大小 | |
xwer_t | xwmm_mempool_memalign (struct xwmm_mempool *mp, xwsz_t alignment, xwsz_t size, void **membuf) |
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/.
在文件 allocator.h 中定义.