函数逻辑报告 |
Source Code:lib\assoc_array.c |
Create Date:2022-07-27 07:51:18 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Handle insertion into a terminal node.
函数原型:static bool assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit, const struct assoc_array_ops *ops, const void *index_key, struct assoc_array_walk_result *result)
返回类型:bool
参数:
类型 | 参数 | 名称 |
---|---|---|
struct assoc_array_edit * | edit | |
const struct assoc_array_ops * | ops | |
const void * | index_key | |
struct assoc_array_walk_result * | result |
499 | free_slot等于负1 |
504 | 以i小于Number of slots per node 循环 |
506 | 如果非ptr则 |
524 | 如果free_slot大于等于0则 |
527 | adjust_count_on等于node |
529 | 返回:true |
540 | 如果非new_n0则返回:false |
542 | new_meta[0]等于assoc_array_node_to_ptr(new_n0) |
544 | 如果非new_n1则返回:false |
546 | new_meta[1]等于assoc_array_node_to_ptr(new_n1) |
549 | 打印调试信息("no spare slots\n") |
550 | have_meta = false |
551 | 以i小于Number of slots per node 循环 |
553 | 如果assoc_array_ptr_is_meta(ptr)则 |
560 | base_seg右移等于level按位与ASSOC_ARRAY_KEY_CHUNK_MASK位 |
561 | segment_cache[i]等于base_seg按位与ASSOC_ARRAY_FAN_MASK |
564 | 如果have_meta则 |
565 | 打印调试信息("have meta\n") |
566 | 转到:split_node |
570 | dissimilarity等于0 |
571 | base_seg等于segment_cache[0] |
572 | 以i小于Number of slots per node 循环dissimilarity或等于segment_cache[i]按位异或base_seg |
575 | 打印调试信息("only leaves; dissimilarity=%lx\n", dissimilarity) |
577 | 如果dissimilarity按位与ASSOC_ARRAY_FAN_MASK的值恒等于0则 |
581 | 如果segment_cache[Number of slots per node ]按位异或base_seg的值恒等于0则转到:all_leaves_cluster_together |
592 | 打印调试信息("present leaves cluster but not new leaf\n") |
595 | split_node : |
596 | 打印调试信息("split node\n") |
613 | to等于assoc_array_node_to_ptr(new_n0) |
614 | back_pointer等于back_pointer |
615 | parent_slot等于parent_slot |
617 | parent_slot等于负1 |
619 | do_split_node : |
620 | 打印调试信息("do_split_node\n") |
623 | nr_leaves_on_branch等于0 |
631 | 以i小于Number of slots per node 循环 |
632 | slot等于segment_cache[i] |
633 | 如果slot不等于0xff则以j小于Number of slots per node 加1循环 |
635 | 如果segment_cache[j]恒等于slot则转到:found_slot_for_multiple_occupancy |
640 | BUG_ON(i >= Number of slots per node ) |
641 | BUG_ON(j >= Number of slots per node + 1) |
642 | BUG_ON(slot >= Number of slots per node ) |
644 | parent_slot等于slot |
647 | 以i小于Number of slots per node 循环如果assoc_array_ptr_is_meta(slots[i])则 |
653 | slots[slot]等于assoc_array_node_to_ptr(new_n1) |
656 | free_slot等于负1 |
657 | next_slot等于0 |
658 | 以i小于Number of slots per node 循环 |
659 | 如果assoc_array_ptr_is_meta(slots[i])则继续下一循环 |
661 | 如果segment_cache[i]恒等于slot则 |
663 | nr_leaves_on_branch自加 |
664 | 否则 |
674 | 如果segment_cache[Number of slots per node ]不等于slot则 |
680 | 否则 |
682 | adjust_count_on等于new_n1 |
688 | 以i小于Number of slots per node 循环 |
689 | 如果segment_cache[i]恒等于0xff则 |
691 | BUG_ON(assoc_array_ptr_is_leaf(ptr)) |
692 | 如果assoc_array_ptr_is_node(ptr)则 |
693 | side等于assoc_array_ptr_to_node(ptr) |
694 | set_backpointers[i]等于back_pointer |
695 | 否则 |
697 | set_backpointers[i]等于back_pointer |
702 | ptr等于back_pointer |
703 | 如果非ptr则ptr等于The node at the root of the tree |
705 | 否则如果assoc_array_ptr_is_node(ptr)则ptr等于slots[parent_slot] |
709 | excised_meta[0]等于assoc_array_node_to_ptr(node) |
711 | 返回:true |
728 | 打印调试信息("all leaves cluster together\n") |
730 | 以i小于Number of slots per node 循环 |
731 | x等于diff_objects(assoc_array_ptr_to_leaf(slots[i]), index_key) |
739 | BUG_ON(diff < level + ASSOC_ARRAY_LEVEL_STEP) |
742 | keylen右移等于ASSOC_ARRAY_KEY_CHUNK_SHIFT位 |
746 | 如果非new_s0则返回:false |
748 | new_meta[2]等于assoc_array_shortcut_to_ptr(new_s0) |
751 | back_pointer等于back_pointer |
752 | parent_slot等于parent_slot |
755 | parent_slot等于0 |
757 | parent_slot等于负1 |
759 | skip_to_level等于level等于diff按位与ASSOC_ARRAY_LEVEL_STEP_MASK的反 |
763 | 以i小于keylen循环index_key[i]等于get_key_chunk(index_key, i * Key data retrieved in chunks of this size ) |
767 | 如果level按位与ASSOC_ARRAY_KEY_CHUNK_MASK则 |
768 | blank等于ULONG_MAX左移level按位与ASSOC_ARRAY_KEY_CHUNK_MASK的值位 |
776 | 以i小于Number of slots per node 循环 |
780 | base_seg右移等于level按位与ASSOC_ARRAY_KEY_CHUNK_MASK位 |
781 | segment_cache[i]等于base_seg按位与ASSOC_ARRAY_FAN_MASK |
784 | base_seg等于get_key_chunk(index_key, level) |
785 | base_seg右移等于level按位与ASSOC_ARRAY_KEY_CHUNK_MASK位 |
787 | 转到:do_split_node |
名称 | 描述 |
---|---|
assoc_array_insert | assoc_array_insert - Script insertion of an object into an associative array*@array: The array to insert into |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |