Function report |
Source Code:lib\genalloc.c |
Create Date:2022-07-28 06:56:55 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:gen_pool_alloc_algo_owner - allocate special memory from the pool*@pool: pool to allocate from*@size: number of bytes to allocate from the pool*@algo: algorithm passed from caller*@data: data passed to algorithm*@owner: optionally retrieve the chunk owner
Proto:unsigned long gen_pool_alloc_algo_owner(struct gen_pool *pool, size_t size, genpool_algo_t algo, void *data, void **owner)
Type:unsigned long
Parameter:
Type | Parameter | Name |
---|---|---|
struct gen_pool * | pool | |
size_t | size | |
genpool_algo_t | algo | |
void * | data | |
void ** | owner |
279 | addr = 0 |
290 | If size == 0 Then Return 0 |
296 | If size > atomic_long_read( & avail) Then Continue |
299 | start_bit = 0 |
300 | end_bit = chunk_size(chunk) >> order |
301 | retry : |
302 | start_bit = algo(map for allocating memory chunk , end_bit, start_bit, nbits, data, pool, start address of memory chunk ) |
307 | If remain Then |
311 | Go to retry |
314 | addr = start address of memory chunk + (start_bit << order) |
316 | atomic_long_sub(size, & avail) |
317 | If owner Then owner = private data to retrieve at alloc time |
319 | Break |
322 | Return addr |
Name | Describe |
---|---|
gen_pool_alloc_owner | |
gen_pool_alloc_algo |
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 |