Function report |
Source Code:kernel\debug\kdb\kdb_support.c |
Create Date:2022-07-28 11:43:28 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:debug_kmalloc
Proto:void *debug_kmalloc(size_t size, gfp_t flags)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| size_t | size | |
| gfp_t | flags |
| 749 | void * p = NULL |
| 750 | If Not get_dap_lock() Then |
| 752 | Return NULL |
| 754 | h = debug_alloc_pool + dah_first |
| 755 | If dah_first_call Then |
| 756 | size = size of debug_alloc_pool_aligned - dah_overhead |
| 757 | dah_first_call = 0 |
| 759 | size = @a is a power of 2 value (size, The memory returned by this allocator must be aligned, which means* so must the header size) |
| 761 | When 1 cycle |
| 768 | If Not ffset of next header from start of pool Then Break |
| 777 | If ffset of next header from start of pool == 0 && bestprev == NULL && rem < dah_overhead Then Go to out |
| 779 | If rem >= dah_overhead Then |
| 781 | h_offset = best - debug_alloc_pool + dah_overhead + size |
| 783 | h = debug_alloc_pool + h_offset |
| 784 | size = rem - dah_overhead |
| 786 | Else h_offset = ffset of next header from start of pool |
| 788 | caller = __builtin_return_address(0) |
| 790 | dah_used_max = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(dah_used, dah_used_max) |
| 791 | If bestprev Then ffset of next header from start of pool = h_offset |
| 795 | p = best + dah_overhead |
| 796 | memset(p, r use-uninitialised poisoning , size - 1) |
| 797 | *( p + size - 1) = d-byte of poisoning |
| 798 | out : |
| 800 | Return p |
| 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 |