Skip to content

Conversation

@6unYoung
Copy link
Contributor

@6unYoung 6unYoung commented Nov 28, 2025

๐Ÿ”— Related Issue

โŒจ๏ธ What I did

  • prefix_t์˜ parent_prefix, child_prefix_items ํ•„๋“œ๋ฅผ ์šฉ๋„์— ๋งž๊ฒŒ NESTED_PREFIX ํƒœ๊ทธ๋กœ ๋ฌถ์—ˆ์Šต๋‹ˆ๋‹ค.
  • NESTED_PREFIX ํƒœ๊ทธ๊ฐ€ ์ •์˜๋˜์—ˆ์„ ๋•Œ๋งŒ ํ•ด๋‹น ๋ณ€์ˆ˜๋“ค์ด ์‚ฌ์šฉ๋˜๊ฒŒ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.

@jhpark816 jhpark816 requested a review from ing-eoking December 1, 2025 02:57
#else
if (PREFIX_IS_RSVD(key, pt->nprefix)) {
pt->internal = 1; /* internal prefix */
}
Copy link
Collaborator

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๋งŒ ๋‹ด๋„๋ก ํ•  ์ˆ˜ ์žˆ๋‚˜์š”?

Copy link
Contributor Author

@6unYoung 6unYoung Dec 2, 2025

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๋ฅผ ๊ณ ๋ คํ•˜์ง€ ์•Š์•„ ๋ฐœ์ƒํ•œ ๋ฌธ์ œ๋ผ ์ด ๋ถ€๋ถ„๋„ ๊ฐ™์ด ์ˆ˜์ •ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

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;
Copy link
Collaborator

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๋ฅผ ํ™œ์šฉํ•  ๋•Œ๋ฅผ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์žˆ๋‚˜์š”?

Copy link
Contributor Author

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()์—์„œ ๋‘ ๊ฒฝ์šฐ์˜ ๋กœ์ง ์ž์ฒด๋ฅผ ๋ถ„๋ฆฌํ•ด์•ผ ํ• ํ…๋ฐ, ๊ฐ€๋…์„ฑ์ด ๋–จ์–ด์ง€์ง€ ์•Š์„๊นŒ์š”?

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.

2 participants