函数逻辑报告 |
Source Code:lib\test_meminit.c |
Create Date:2022-07-27 07:35:12 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Test kmem_cache with given parameters:
函数原型:static int __init do_kmem_cache_size(size_t size, bool want_ctor, bool want_rcu, bool want_zero, int *total_failures)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
size_t | size | |
bool | want_ctor | use a constructor; |
bool | want_rcu | use SLAB_TYPESAFE_BY_RCU; |
bool | want_zero | use __GFP_ZERO. |
int * | total_failures |
201 | bool fail = false |
202 | alloc_mask等于GFP_KERNEL按位或如果 use __GFP_ZERO.则__GFP_ZERO否则0 |
210 | 如果非 use SLAB_TYPESAFE_BY_RCU;且非 use a constructor;则 |
213 | ret等于kmem_cache_alloc_bulk(c, alloc_mask, BULK_SIZE, bulk_array) |
214 | 如果非ret则 |
215 | fail = true |
216 | 否则 |
220 | kmem_cache_free_bulk(c, ret, bulk_array) |
224 | buf等于kmem_cache_alloc(c, alloc_mask) |
229 | 如果非 use SLAB_TYPESAFE_BY_RCU;则 |
230 | kmem_cache_free(c, buf) |
231 | 继续下一循环 |
247 | kmem_cache_free(c, buf) |
255 | 如果buf_copy则 |
261 | 删除高速缓存区 |
263 | total_failures加等于fail |
264 | 返回:1 |
名称 | 描述 |
---|---|
test_kmemcache | Test kmem_cache allocation by creating caches of different sizes, with and* without constructors, with and without SLAB_TYPESAFE_BY_RCU. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |