| Function report | 
| Source Code: mm\zsmalloc.c | Create Date:2022-07-28 16:27:44 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:zs_malloc - Allocate block of given size from pool.*@pool: pool to allocate from*@size: size of block to allocate*@gfp: gfp flags when allocating object* On success, handle to the allocated object is returned,* otherwise 0.
Proto:unsigned long zs_malloc(struct zs_pool *pool, size_t size, gfp_t gfp)
Type:unsigned long
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct zs_pool * | pool | |
| size_t | size | |
| gfp_t | gfp | 
| 1466 | If Value for the false possibility is greater at compile time(!size || size > ach chunk includes extra space to keep handle ) Then Return 0 | 
| 1469 | handle = cache_alloc_handle(pool, gfp) | 
| 1470 | If Not handle Then Return 0 | 
| 1474 | size += ZS_HANDLE_SIZE | 
| 1478 | zspage = find_get_zspage(class) | 
| 1479 | If Value is more likely to compile time(zspage) Then | 
| 1480 | obj = obj_malloc(class, zspage, handle) | 
| 1483 | record_obj(handle, obj) | 
| 1484 | spin_unlock( & lock) | 
| 1486 | Return handle | 
| 1489 | spin_unlock( & lock) | 
| 1492 | If Not zspage Then | 
| 1493 | cache_free_handle(pool, handle) | 
| 1494 | Return 0 | 
| 1498 | obj = obj_malloc(class, zspage, handle) | 
| 1501 | set_zspage_mapping(zspage, index, newfg) | 
| 1502 | record_obj(handle, obj) | 
| 1503 | atomic_long_add( Number of PAGE_SIZE sized pages to combine to form a 'zspage' , & pages_allocated) | 
| 1508 | SetZsPageMovable(pool, zspage) | 
| 1509 | spin_unlock( & lock) | 
| 1511 | Return handle | 
| Name | Describe | 
|---|---|
| zs_zpool_malloc | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |