• Image placeholder
  • 홈 페이지
  • 블로그 센터
  • 범주
Image placeholder

Ownership

[0x02] Understanding Onwership

하나의 값에는 하나의 owner만 있을 수 있다. 메모리를 할당(allocate)하는 것은 String::from 메소드를 호출할 때 일어난다. Rust에서는 String과 같은 힙 영역에 할당되는 데이터에 관해 아래 그림과 같이 이해할 수 있다. 특히, 튜플의 경우 내부 원소들이 모두 Copy가 구현된 타입이라면 Copy를 사용할 수 있다. 즉, 저장되는 공간이 스택, 힙 둘 중 어느 곳이...

RustOwnershipOwnership

© 2022 intrepidgeeks.com

Privacy Policy Contact US Sitemap
🍪 This website uses cookies to ensure you get the best experience on our website. Learn more