Skip to content
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

INTERNAL: Refactor the structure of additional item in mblck #756

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ing-eoking
Copy link
Collaborator

@ing-eoking ing-eoking commented Apr 26, 2024

๐Ÿ”— Related Issue

  • jam2in/arcus-works#539

โŒจ๏ธ What I did

1. memory block ์—์„œ value_item ๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

  • Additional ritem์œผ๋กœ ํ™œ์šฉ๋˜๋Š” ์•„๋ž˜์˜ 3๊ฐ€์ง€ item์ด ๋™์ผํ•œ ํƒ€์ž…์„ ๊ฐ–๊ฒŒ ๋” ํ•˜๊ธฐ ์œ„ํ•จ์ž…๋‹ˆ๋‹ค.
    • hash item : value_item
    • element item : value_item
    • memory block item : mblck_node_t
  • value_item์œผ๋กœ ๋ณ€๊ฒฝ ์‹œ ์•„๋ž˜ ์‚ฌํ•ญ์„ ๊ณ ๋ คํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค.
    • memory block์˜ body_len ๊ณ„์‚ฐ
      - pool->body_len = blck_len - sizeof(void *);
      + pool->body_len = blck_len - (sizeof(void *) + sizeof(uint32_t))

2. Memory Block List ์ž๋ฃŒ ๊ตฌ์กฐ ๋‚ด์—์„œ Head๋ฅผ ์ œ์™ธํ•œ Memory Block์„ Additional List์— ๋„ฃ์–ด๋‘ก๋‹ˆ๋‹ค.

  • Additional List๋Š” ์ธ๋ฑ์Šค ๊ธฐ๋ฐ˜(rindex)์œผ๋กœ ๋‹ค์Œ item์— ์ ‘๊ทผํ•  ๋•Œ ํ™œ์šฉ๋ฉ๋‹ˆ๋‹ค.

๐ŸŽฏ To Do

  • Ubuntu์—์„œ unit test ์‹คํŒจ ๋ฐœ์ƒ : ์›์ธ ํŒŒ์•…์ค‘
    • ์ดˆ๊ธฐ๊ฐ’์œผ๋กœ NULL์ด ๋“ค์–ด๊ฐ€์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Œ
  • ๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ ๋กœ์ง ์ถ”๊ฐ€
  • mblck_list ์—์„œ body_len ์ œ๊ฑฐ : value_item ๋‚ด๋ถ€์— len ์ •๋ณด๋ฅผ ๋‹ด์Œ
  • ๊ด€๋ จ ๋งคํฌ๋กœ ์ •๋ฆฌ
  • ๋งํฌ๋“œ๋ฆฌ์ŠคํŠธ ์กฐํšŒ๋ฅผ ์œ„ํ•ด ์‚ฌ์šฉ๋œ c->membk ์ œ๊ฑฐ

@ing-eoking ing-eoking marked this pull request as ready for review June 17, 2024 01:33
@ing-eoking ing-eoking marked this pull request as draft June 19, 2024 08:49
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.

None yet

1 participant