INTERNAL: Refactor the structure of additional item in mblck#756
Open
ing-eoking wants to merge 1 commit into
Open
INTERNAL: Refactor the structure of additional item in mblck#756ing-eoking wants to merge 1 commit into
ing-eoking wants to merge 1 commit into
Conversation
779a775 to
0e59fb1
Compare
Collaborator
Author
|
해당 PR도 리뷰 부탁드립니다. |
namsic
reviewed
Oct 17, 2024
Comment on lines
45
to
+47
| mblck_node_t *head; | ||
| mblck_node_t *tail; | ||
| value_item **addnl; |
Collaborator
There was a problem hiding this comment.
head의next를 통해 전체 item에 접근 가능할 것인데,addnl을 두는 이유는 무엇인가요?value_itemarray를 둔다면, tail 등 링크드리스트 관련 field를 제거할 수 있는 것이 아닌지?
Collaborator
There was a problem hiding this comment.
addnl은 ritem read 시 활용하기 위하여 추가한 것 (HINFO, EINFO와 유사한 구조를 갖도록)- mblck은 ritem read 외에도 활용하는 경우가 있는데 (
tokenize_XXX()), 이 때 list 방식의 구현이 필요하다고 함 - 따라서 PR 구현에서는 하나의 데이터를 array 방식으로도 접근(
ritem_set_XXX())할 수 있고,
기존 list 방식으로도 접근(tokenize_XXX())할 수 있도록 구현한 상태
| pool->head = NULL; | ||
| pool->blck_len = blck_len; | ||
| pool->body_len = blck_len - sizeof(void *); | ||
| pool->body_len = blck_len - (sizeof(void *) + sizeof(uint32_t)); |
Collaborator
There was a problem hiding this comment.
sizeof(void *)와 sizeof(uint32_t)는 각각 어떤 값의 크기인가요?
Collaborator
There was a problem hiding this comment.
old
| <----- blck_len -----> |
| <- body_len -> |
--------------------------
| *next | data |
new
| <-------- blck_len --------> |
| <--- value_item ---> |
| <- body_len -> |
--------------------------
| *next | len | ptr |
value_item.len과pool->body_len은 결국에는 같은 값을 갖게 된다고 함
Collaborator
|
@ing-eoking |
Collaborator
Author
|
오래 전에 진행한 이후로 진행되지 않았습니다. 당시 논의한 결과, 현재로서는 보다 깔끔한 프로토콜 모듈화를 위해 해당 방식으로 변경하는 방법 외에는 떠오르지 않지만, |
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
1. memory block 에서 value_item 를 사용하도록 변경합니다.
2. Memory Block List 자료 구조 내에서 Head를 제외한 Memory Block을 Additional List에 넣어둡니다.
🎯 To Do
Ubuntu에서 unit test 실패 발생 : 원인 파악중