Function report |
Source Code:mm\slab.c |
Create Date:2022-07-28 15:45:34 |
| Last Modify:2022-05-23 17:02:55 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:slab_alloc
Proto:static __always_inline void *slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct kmem_cache * | cachep | |
| gfp_t | flags | |
| unsigned long | caller |
| 3353 | flags &= gfp_allowed_mask |
| 3354 | cachep = slab_pre_alloc_hook(cachep, flags) |
| 3355 | If Value for the false possibility is greater at compile time(!cachep) Then Return NULL |
| 3359 | local_irq_save(save_flags) |
| 3360 | objp = __do_cache_alloc(cachep, flags) |
| 3361 | local_irq_restore(save_flags) |
| 3365 | If Value for the false possibility is greater at compile time(slab_want_init_on_alloc(flags, cachep)) && objp Then memset(objp, 0, The size of an object without metadata ) |
| 3368 | slab_post_alloc_hook(cachep, flags, 1, & objp) |
| 3369 | Return objp |
| Name | Describe |
|---|---|
| kmem_cache_alloc | kmem_cache_alloc - Allocate an object*@cachep: The cache to allocate from |
| __do_kmalloc | __do_kmalloc - allocate memory*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@caller: function caller for debug tracking of the caller* Return: pointer to the allocated memory or %NULL in case of error |
| 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 |