Skip to content

Latest commit

Β 

History

History
28 lines (17 loc) Β· 1.1 KB

File metadata and controls

28 lines (17 loc) Β· 1.1 KB

ν”„λ‘œμ„ΈμŠ€μ˜ μ£Όμ†Œ 곡간

ν”„λ‘œκ·Έλž¨μ΄ CPU에 μ˜ν•΄ 싀행됨 β†’ ν”„λ‘œμ„ΈμŠ€κ°€ μƒμ„±λ˜κ³  λ©”λͺ¨λ¦¬μ— 'ν”„λ‘œμ„ΈμŠ€ μ£Όμ†Œ 곡간'이 할당됨

ν”„λ‘œμ„ΈμŠ€ μ£Όμ†Œ κ³΅κ°„μ—λŠ” μ½”λ“œ, 데이터, μŠ€νƒμœΌλ‘œ 이루어져 μžˆλ‹€.

  • μ½”λ“œ Segment : ν”„λ‘œκ·Έλž¨ μ†ŒμŠ€ μ½”λ“œ μ €μž₯
  • 데이터 Segment : μ „μ—­ λ³€μˆ˜ μ €μž₯
  • μŠ€νƒ Segment : ν•¨μˆ˜, 지역 λ³€μˆ˜ μ €μž₯

μ™œ μ΄λ ‡κ²Œ ꡬ역을 λ‚˜λˆˆκ±΄κ°€μš”?

μ΅œλŒ€ν•œ 데이터λ₯Ό κ³΅μœ ν•˜μ—¬ λ©”λͺ¨λ¦¬ μ‚¬μš©λŸ‰μ„ 쀄여야 ν•©λ‹ˆλ‹€.

CodeλŠ” 같은 ν”„λ‘œκ·Έλž¨ μžμ²΄μ—μ„œλŠ” λͺ¨λ‘ 같은 λ‚΄μš©μ΄κΈ° λ•Œλ¬Έμ— λ”°λ‘œ κ΄€λ¦¬ν•˜μ—¬ κ³΅μœ ν•¨

Stackκ³Ό 데이터λ₯Ό λ‚˜λˆˆ μ΄μœ λŠ”, μŠ€νƒ ꡬ쑰의 νŠΉμ„±κ³Ό μ „μ—­ λ³€μˆ˜μ˜ ν™œμš©μ„±μ„ μœ„ν•œ 것!


ν”„λ‘œκ·Έλž¨μ˜ ν•¨μˆ˜μ™€ 지역 λ³€μˆ˜λŠ”, LIFO(κ°€μž₯ λ‚˜μ€‘μ— λ“€μ–΄κ°„κ²Œ λ¨Όμ € λ‚˜μ˜΄)νŠΉμ„±μ„ 가진 μŠ€νƒμ—μ„œ μ‹€ν–‰λœλ‹€. 
λ”°λΌμ„œ 이 ν•¨μˆ˜λ“€ μ•ˆμ—μ„œ κ³΅ν†΅μœΌλ‘œ μ‚¬μš©ν•˜λŠ” 'μ „μ—­ λ³€μˆ˜'λŠ” λ”°λ‘œ 지정해주면 λ©”λͺ¨λ¦¬λ₯Ό μ•„λ‚„ 수 μžˆλ‹€.