Skip to Content
이펙티브 러스트
book

이펙티브 러스트

by 데이비드 드라이스데일, 남기혁
October 2024
Beginner to intermediate
344 pages
7h 44m
Korean
Hanbit Media, Inc.
Content preview from 이펙티브 러스트
149
3
주요 개념
어떻게든 찾아내서 음흉한 미소를 지으며 이 포인터를 역참조하는 방식으로 시스템을 공격할
것이다.
하지만 러스트에는 이런 위험이 없다. 러스트에서 가장 매력적인 특징이 바로 이런 댕글링 포
인터 문제를 근본적으로 해결했다는 점이다. 따라서 보안 문제의 상당 부분이 저절로 해결
됐다.
1
이러한 특성 덕분에 그동안 내부적으로 가려져 있던, 그래서
C
/
C
++ 프로그래머가 언어 차원
의 도움 없이 직접 책임져야 했던
수명
lifetime
이란 개념이 전면에 등장하게 된 것이다. 앰퍼샌드
(
&
)가 붙은 타입은 모두 수명(
'
a
)을 갖는다. 물론 이를 생략해도 대부분은 컴파일러가 처리해
준다.
수명의 스코프
스택에 담긴 항목의 수명이란 그 항목이 유지되도록 보장되는 기간이다. 다시 말해 항목에 대
한 레퍼런스(포인터)가 무효화되지 않는다고 보장되는 기간이다.
수명은 항목이 생성될 때 시작해서 그 항목이 드롭 (제거)
drop
되거나 이동
move
할 때 끝난다. 여
기서 드롭이란
C
++의 객체 소멸
destruction
에 대한 러스트의 표현 방식이다.
C
/
C
++에 익숙한 프로그래머라면 이동할 때 수명이 끝나는 경우가 많다는 사실에 놀랄 것이
다. 러스트에서는 스택 안의 한 지점에서 다른 지점으로, 스택에서 힙으로, 힙에서 스택으로 이
동하는 경우가 상당히 많다. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리

Publisher Resources

ISBN: 9791169212946