Tag

RAII

0 views collected around this technical thread.

Deepin Linux
Deepin Linux
Dec 26, 2024 · Fundamentals

Understanding C++ Smart Pointers: Types, Mechanisms, and Best Practices

This article explains how C++ smart pointers—unique_ptr, shared_ptr, weak_ptr and the deprecated auto_ptr—use RAII and reference‑counting to automate memory management, avoid leaks and dangling pointers, and provide guidelines, performance analysis, and practical usage tips for modern C++ development.

C++Memory ManagementRAII
0 likes · 36 min read
Understanding C++ Smart Pointers: Types, Mechanisms, and Best Practices
Deepin Linux
Deepin Linux
Aug 26, 2024 · Fundamentals

Understanding and Preventing Memory Leaks in C++ Applications

The article explains what memory leaks are, common causes, and presents practical techniques such as avoiding heap allocations, using smart pointers, employing arena allocators, leveraging coroutines, applying RAII, and debugging with tools like gperftools to detect and resolve leaks in C++ programs.

C++CoroutineMemory Leak
0 likes · 12 min read
Understanding and Preventing Memory Leaks in C++ Applications
Deepin Linux
Deepin Linux
Apr 18, 2024 · Fundamentals

C++ Memory Management: Concepts, Pitfalls, and Best Practices

This article provides a comprehensive overview of C++ memory management, covering stack vs heap allocation, deep vs shallow copying, common errors such as leaks, dangling pointers, double frees, and offers practical techniques like custom new/delete overloads, smart pointers, RAII, and tools for detecting memory problems.

C++Leak DetectionMemory Management
0 likes · 92 min read
C++ Memory Management: Concepts, Pitfalls, and Best Practices
Tencent Cloud Developer
Tencent Cloud Developer
Feb 22, 2024 · Databases

MongoDB Lock Mechanisms and Implementation Details

MongoDB’s locking system uses a hierarchical resource model with four lock modes, RAII‑style acquisition classes, ticket‑based throttling, and a bucketed lock manager that employs bit‑mask conflict checks and priority flags to grant exclusive locks promptly and prevent starvation.

DatabaseLock ManagerLocks
0 likes · 42 min read
MongoDB Lock Mechanisms and Implementation Details
Tencent Cloud Developer
Tencent Cloud Developer
Dec 19, 2023 · Fundamentals

Object-Oriented Analysis and Design: Exception Handling, RAII, and Error‑Code Practices

The article explains how object‑oriented analysis and design should treat exceptions by using RAII for automatic resource cleanup, avoiding error‑code patterns, and adopting a throw‑by‑default policy with strongly‑typed exceptions, illustrating concepts with C++ and VB.NET examples and framework design recommendations.

C++Error CodesException Handling
0 likes · 38 min read
Object-Oriented Analysis and Design: Exception Handling, RAII, and Error‑Code Practices