-
Notifications
You must be signed in to change notification settings - Fork 56
INTERNAL: Bundle nested fields of prefix_t with NESTED_PREFIX #938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| #else | ||
| if (PREFIX_IS_RSVD(key, pt->nprefix)) { | ||
| pt->internal = 1; /* internal prefix */ | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ง์ฝ DEFAULT_PREFIX_MAX_DEPTH ๊ฐ์ด 1๋ณด๋ค ํฐ ๊ฒฝ์ฐ Non-nested prefix ์ํฉ์์๋ delimeter๋ฅผ ๊ธฐ์ค์ผ๋ก prefix๊ฐ ์ฌ๋ฌ ๊ฐ ์์ฑ๋์ด prefix_list์ ๊ฐ๊ฐ ๋ด๊ธฐ๊ฒ ๋ฉ๋๋ค.
Non Nested ๊ตฌ์กฐ์ผ ๋๋ 1๊ฐ์ prefix๋ง ๋ด๋๋ก ํ ์ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ค ๊ฐ๋ฅํฉ๋๋ค. prefix_list ์์ฑ ์ NESTED_PREFIX๊ฐ ์ ์๋์ด ์์ง ์๋ค๋ฉด breakํ๋๋ก ํ๋ฉด ๋ ๋ฏํฉ๋๋ค.
๋ณ๊ฐ๋ก NESTED_PREFIX๋ฅผ ์ ์ํ๊ณ DEFAULT_PREFIX_MAX_DEPTH๊ฐ 5๋ก ์ค์ ํ key๋ฅผ 0:1:2:3:4:5๋ฅผ ์ฃผ๋ ๊ฒฝ์ฐ์, ๊ฐ ๋ ๋ฒจ๋ณ prefix์ ์์ฑ์ ํ์ธ๋ฉ๋๋ค. ํ์ง๋ง stats prefixes๋ stats prefixlist item๋ช
๋ น์ ์
๋ ฅํ์ ๋ 0๊น์ง๋ง ์ถ๋ ฅ๋๋ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
์๋ง๋ stats prefixes/prefixlist์ NESTED_PREFIX๋ฅผ ๊ณ ๋ คํ์ง ์์ ๋ฐ์ํ ๋ฌธ์ ๋ผ ์ด ๋ถ๋ถ๋ ๊ฐ์ด ์์ ํด์ผ ํ ๊ฒ ๊ฐ์ต๋๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Child Prefix์ ๋ํ ์ถ๋ ฅ์ ์๋์ ์ผ๋ก ์ ์ธํ ๊ฒ์ผ๋ก ๋ณด์ ๋๋ค.
if (pt->parent_prefix != NULL) { /* skip child prefixes */
pt = pt->h_next;
continue;
}๋ค๋ง, ํ์ฌ Nested Prefix ๊ธฐ๋ฅ์ ์์ง ์์ ํ ๊ตฌํ๋ ์ํ๊ฐ ์๋๋ฏ๋ก,
์ง๊ธ ์์ ์์๋ NESTED_PREFIX ๊ด๋ จ ๋ถ๋ถ๊น์ง ์์ ํ ํ์๋ ์์ด ๋ณด์
๋๋ค.
| break; | ||
| } | ||
| #ifndef NESTED_PREFIX | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ๋ก์๋ Non-Nested Prefix ๋ก์ง์์ prefix_list, prefix_depth, DEFAULT_PREFIX_MAX_DEPTH๋ฅผ ์ฌ์ฉํ๊ณ ์๋ ๋ถ๋ถ์ด ์กฐ๊ธ ๋ถ์์ฐ์ค๋ฌ์ ๋ณด์ ๋๋ค. ์ด ๋ถ๋ถ์ Non Nested Prefix์ Nested Prefix๋ฅผ ํ์ฉํ ๋๋ฅผ ๋ถ๋ฆฌํ ์ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ NESTED_PREFIX๋ฅผ ์ฌ์ฉํ์ง ์๋ ๊ฒฝ์ฐ์๋ prefix_list[0]์ ์ฌ์ฉํ๊ณ ์์ต๋๋ค. ์ด ๋ณ์๋ฅผ ์ฌ์ฉํ์ง ์๋๋ค๋ฉด prefix_link()์์ ๋ ๊ฒฝ์ฐ์ ๋ก์ง ์์ฒด๋ฅผ ๋ถ๋ฆฌํด์ผ ํ ํ
๋ฐ, ๊ฐ๋
์ฑ์ด ๋จ์ด์ง์ง ์์๊น์?
๐ Related Issue
โจ๏ธ What I did
parent_prefix,child_prefix_itemsํ๋๋ฅผ ์ฉ๋์ ๋ง๊ฒ NESTED_PREFIX ํ๊ทธ๋ก ๋ฌถ์์ต๋๋ค.