Function report |
Source Code:mm\zsmalloc.c |
Create Date:2022-07-28 16:26:55 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:We have to decide on how many pages to link together* to form a zspage for each size class. This is important* to reduce wastage due to unusable space left at end of* each zspage which is given as:* wastage = Zp % class_size* usage = Zp - wastage
Proto:static int get_pages_per_zspage(int class_size)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
int | class_size |
803 | max_usedpc = 0 |
805 | max_usedpc_order = 1 |
807 | When i <= ZS_MAX_PAGES_PER_ZSPAGE cycle |
811 | zspage_size = i * PAGE_SIZE |
812 | waste = zspage_size % class_size |
813 | usedpc = (zspage_size - waste) * 100 / zspage_size |
815 | If usedpc > max_usedpc Then |
816 | max_usedpc = usedpc |
817 | max_usedpc_order = i |
821 | Return max_usedpc_order |
Name | Describe |
---|---|
zs_create_pool | 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. |
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 |