일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Alpha Prime(VLS-128)
- Reflectivity
- Phase Lock
- HDmap
- Data Race
- object detection
- Smart Pointer
- PYTHON
- lidar
- Phase Offset
- coordinate system
- 센서셋
- Single threaded
- PointCloud
- timestamp
- Interference Pattern
- Motion compensate
- Quaternion 연산
- Veloview
- PointCloud Frame
- 3-sigma rule
- Frame rate
- Data Packet
- Multi threaded
- VLS-128
- Alpha Prime
- ApolloAuto
- nvidia
- Coding Test
- Azimuth
- Today
- Total
목록Smart Pointer (3)
엔지니어 동행하기
Smart Pointer는 RAII idiom 기법을 따르며, C++에서 메모리 관리를 위한 핵심 개념입니다. 그중 두 번째로 Shared ownership을 제공하는 std::shared_ptr에 대해 설명드리겠습니다. std::shared_ptr는 잘못 사용할 경우, Circular reference가 발생해 Memory leak이 생길 수 있어 주의가 필요합니다. 또한 std::shared_ptr를 Class의 member variable로 사용할 때, std::unique_ptr과 어떻게 다른지 분석하였습니다. Shared ownership 하나의 Object를 여러 개의 Pointer가 가리킬 수 있다. 그래서 RAII idiom을 따르기 위해 reference counter를 사용한다. 즉, ..
Smart Pointer는 RAII idiom 기법을 따르며, C++에서 메모리 관리를 위한 핵심 개념입니다. 그중 첫 번째로 Exclusive ownership을 보장하는 std::unique_ptr에 대해 다뤄보겠습니다. Exclusive Ownership (Heap memory 상의) 하나의 Object는 하나의 Pointer만 가리킬 수 있음을 의미합니다. #include #include struct D { D() { std::cout
C++ 은 Memory(RAM)을 개발자가 직접 관리할 수있는 HW와 매우 밀접한 언어입니다. 그렇기 때문에 더욱 빠른 코드를 작성할 수 있지만, 잘못 사용할 경우 Segmentation fault, Memory Leak과 같은 문제가 발생할 수 있습니다. 따라서 Smart Pointer를 적절히 사용할 수 있어야 합니다. Smart Pointer 사용 이유 RAII ( Resource Acquisition Is Initailization) : Resource의 life cycle과 Object의 life cycle을 일치시켜 Memory Leak을 원천적으로 방지하기 위함 - Resource : Heap memory, Thread, Mutex, File access, DB connection 등이 이에..