Skip to content

INTERNAL: Fix misleading status comment in btree_elem_item#967

Merged
jhpark816 merged 1 commit intonaver:developfrom
zhy2on:fix/btree-elem-status-comment
Apr 9, 2026
Merged

INTERNAL: Fix misleading status comment in btree_elem_item#967
jhpark816 merged 1 commit intonaver:developfrom
zhy2on:fix/btree-elem-status-comment

Conversation

@zhy2on
Copy link
Copy Markdown

@zhy2on zhy2on commented Apr 9, 2026

🔗 Related Issue

⌨️ What I did

  • btree_elem_item 구조체의 status 필드 주석이 실제 lifecycle 상태값과 맞지 않아 오해를 유발할 수 있었습니다. item_base.h의 주석을 실제 사용 방식(used/unlinked/free lifecycle)에 맞게 수정했습니다.

@jhpark816
Copy link
Copy Markdown
Collaborator

bug fix는 아니어서 아래와 같이 commit message 변경하면 좋겠습니다.

INTERNAL: Fix misleading status comment in btree_elem_item

The old comment listed incorrect values (3/2/1/0) that didn't match
the actual implementation (USED=2, UNLINK=1, FREE=0). Replace with a
description of the lifecycle states instead of enumerating the values.
@zhy2on zhy2on changed the title FIX: Fix misleading status comment in btree_elem_item INTERNAL: Fix misleading status comment in btree_elem_item Apr 9, 2026
@zhy2on zhy2on force-pushed the fix/btree-elem-status-comment branch from e0d0172 to dff1224 Compare April 9, 2026 03:06
@zhy2on
Copy link
Copy Markdown
Author

zhy2on commented Apr 9, 2026

@jhpark816

변경하였습니다.

uint16_t refcount;
uint8_t slabs_clsid; /* which slab class we're in */
uint8_t status; /* 3(used), 2(insert mark), 1(delete_mark), or 0(free) */
uint8_t status; /* element lifecycle state: used(in-tree), unlinked(removed but referenced), or free */
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헤더에서 각 값의 의미를 드러내지 않고, status 필드의 용도만 설명하시죠.

이후에 status 값의 의미가 변경될 가능성은 낮지만,
/* element lifecycle state */ 정도로만 작성해두면 좋겠습니다.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

각 필드 값의 의미를 두는 것이 괜찮아 보입니다.

@jhpark816 jhpark816 merged commit 0d6c58e into naver:develop Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants