INTERNAL: Extract hash tree module from set/map collections#983
Open
zhy2on wants to merge 8 commits into
Open
Conversation
- set_meta_info의 root를 htree_meta htree로 교체 - set_hash_node → htree_node, SET_* 상수 → HTREE_* 상수로 변경 - do_set_node_link/unlink, do_htree_elem_* 함수 시그니처를 htree_meta *로 변경
- map_meta_info의 root를 htree_meta htree로 교체 - map_hash_node → htree_node, MAP_* 상수 → HTREE_* 상수로 변경 - do_map_node_link/unlink, do_htree_elem_* 함수 시그니처를 htree_meta *로 변경
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Issue
⌨️ What I did
set, map 컬렉션에 중복으로 존재하던 hash tree 구현을 hash_tree.c/h로 추출하였습니다.
set_hash_node,map_hash_node및 관련 상수를 제거하고htree_node,htree_meta로 통일하였습니다.set_meta_info,map_meta_info의root필드를htree_meta htree로 교체하였습니다.htree_ops의get_key콜백으로 컬렉션별 키 추출 로직을 분리하였습니다. (기존elem->value/nbytes,elem->data/nfield직접 접근 →htree_ops.get_key콜백으로 추출. set은set_get_key, map은map_get_key를 등록)hash tree의 공개 API를
hash_tree.h에 정의하였습니다.htree_inithtree_elem_findhtree_elem_pos) 반환htree_elem_inserthtree_elem_addhtree_elem_replacehtree_elem_deletehtree_elem_delete_bulkdeleted_head로 chain 반환하여 caller가 후처리htree_elem_getdelete=true면 delete도 수행. elem_array 인자에 반환htree_elem_get_bulkhtree_elem_get_rand