函数逻辑报告 |
Source Code:mm\zsmalloc.c |
Create Date:2022-07-27 18:03:18 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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.
函数原型:struct zs_pool *zs_create_pool(const char *name)
返回类型:struct zs_pool
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| const char * | name |
| 2405 | struct size_class * prev_class = NULL |
| 2408 | 如果非pool则返回:NULL |
| 2411 | init_deferred_free(pool) |
| 2421 | 如果create_cache(pool)则转到:err |
| 2433 | fullness等于0 |
| 2436 | 如果size大于ach chunk includes extra space to keep handle 则size等于ach chunk includes extra space to keep handle |
| 2447 | 如果pages_per_zspage不等于1且objs_per_zspage不等于1且非huge_class_size则 |
| 2449 | huge_class_size等于size |
| 2459 | huge_class_size减等于ZS_HANDLE_SIZE减1 |
| 2471 | 如果prev_class则 |
| 2472 | 如果can_merge(prev_class, pages_per_zspage, objs_per_zspage)则 |
| 2473 | size_class[i]等于prev_class |
| 2474 | 继续下一循环 |
| 2486 | spin_lock_init( & lock) |
| 2487 | size_class[i]等于class |
| 2488 | 以fullness小于NR_ZS_FULLNESS循环初始化链表头 |
| 2492 | prev_class等于class |
| 2496 | zs_pool_stat_create(pool, name) |
| 2498 | 如果zs_register_migration(pool)则转到:err |
| 2507 | zs_register_shrinker(pool) |
| 2509 | 返回:pool |
| 2511 | err : |
| 2512 | zs_destroy_pool(pool) |
| 2513 | 返回:NULL |
| 名称 | 描述 |
|---|---|
| zs_zpool_create | zpool driver |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |