函数逻辑报告 |
Source Code:mm\zsmalloc.c |
Create Date:2022-07-27 18:01:51 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:We have to decide on how many pages to link together* to form a zspage for each size class. This is important* to reduce wastage due to unusable space left at end of* each zspage which is given as:* wastage = Zp % class_size* usage = Zp - wastage
函数原型:static int get_pages_per_zspage(int class_size)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| int | class_size |
| 803 | max_usedpc等于0 |
| 805 | max_usedpc_order等于1 |
| 807 | 以i小于等于ZS_MAX_PAGES_PER_ZSPAGE循环 |
| 811 | zspage_size等于i乘PAGE_SIZE |
| 812 | waste等于zspage_size取模class_size |
| 813 | usedpc等于zspage_size减waste的差乘100除zspage_size |
| 815 | 如果usedpc大于max_usedpc则 |
| 816 | max_usedpc等于usedpc |
| 817 | max_usedpc_order等于i |
| 821 | 返回:max_usedpc_order |
| 名称 | 描述 |
|---|---|
| zs_create_pool | zs_create_pool - Creates an allocation pool to work from.*@name: pool name to be created* This function must be called before anything when using* the zsmalloc allocator.* On success, a pointer to the newly created pool is returned,* otherwise NULL. |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |