A Review of C++ Smart Pointers: Types, Usage, and Practical Scenarios

A Review of C++ Smart Pointers: Types, Usage, and Practical Scenarios

πŸ‘†Click the blue text "Linux Armory" at the top, and select "Add to Favorites" in the upper right corner to not miss out on great articles and see valuable content first. πŸ‘†FollowLinux Armory, to receive hardcore Linux learning materials and code. Today, let’s revisit smart pointers in C++. In C++ resource management, manually using <span>new</span>/<span>delete</span> … Read more

A Brief Overview | File Handles in Linux Systems – Knowledge Points Learning

A Brief Overview | File Handles in Linux Systems - Knowledge Points Learning

This article mainly explains the knowledge related to file handles in Linux (File Handle) and commands. A file handle (FD) is a non-negative integer that serves as anindex, allowing a process to find the corresponding information of anopen file in itsfile descriptor table. Essentially, it is an abstract reference to all I/O resources, representing not … Read more

In-Depth Understanding of QoS Systems in SoC Chips

In-Depth Understanding of QoS Systems in SoC Chips

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Copyright Statement: Author: Wang Weiwei. Mainly engaged in ISP/GPU/video/automotive chips/AI chips/SoC architecture design Zhihu Column: Advanced Path of Chip Design WeChat Official Account: Advanced Path of Chip Design (x_chip) Can be forwarded without authorization, but this statement must be retained, otherwise legal action will be taken! β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” Currently, we are in a data-driven intelligent … Read more

C++ Programming Tips: Resource Management Classes Must Provide Access to Raw Resources

C++ Programming Tips: Resource Management Classes Must Provide Access to Raw Resources

Many libraries and functions we use require us to pass raw resources instead of a resource management class object. Therefore, it is essential to design methods in resource management classes to access raw resources. Currently, there are two mainstream methods: 1. Explicit Conversion (Recommended) This method involves designing a function that returns the internal raw … Read more

The ‘Housekeeping’ of C++: A Deep Dive into the Rule of Three/Five/Zero

The 'Housekeeping' of C++: A Deep Dive into the Rule of Three/Five/Zero

The ‘Housekeeping’ of C++: A Deep Dive into the Rule of Three/Five/Zero From Manual to Automatic: Unveiling the Evolution of Resource Management in C++ Classes Introduction: Who Moved My Resources? Hello, C++ developers. In C++, when your class starts to directly manage resourcesβ€”such as allocating memory with <span>new</span>, opening file handles, or establishing network connectionsβ€”you … Read more

Understanding Multi-Mining: What It Is, Why It’s Popular, and How to Choose and Calculate

Understanding Multi-Mining: What It Is, Why It's Popular, and How to Choose and Calculate

For beginners: Explaining Multi-Mining clearlyβ€”what it is, why it is popular, how to choose and calculate, and what pitfalls to avoid. (Informational content, not investment advice) 1. What Is It Multi-Mining refers to using the same set of equipment/same account system to participate in multiple decentralized networks (DePIN/PoW/bandwidth/storage/data crowdsourcing, etc.) for mining or task revenue … Read more

C++ Programming Guidelines – Constructors, Assignment, and Destructors

C++ Programming Guidelines - Constructors, Assignment, and Destructors

01 Classes containing member variables must define a constructor or a default constructor. Note: If a class has member variables and does not define a constructor or a default constructor, the compiler will automatically generate a constructor, but the compiler-generated constructor will not initialize the member variables, leaving the object in an uncertain state.Exception: If … Read more

C++ Programming Tips: Managing Resources with Smart Pointers

C++ Programming Tips: Managing Resources with Smart Pointers

Resources refer to entities that, once used, must be returned to the system. For example, dynamically allocated memory using “new” needs to be returned to the system with “delete”, as well as resources like bitmaps and brushes. 1. Disadvantages of Manual Resource Management Consider the following example: We “new” a resource and return it to … Read more

RAII Technique in C++: Resource Acquisition Is Initialization

RAII Technique in C++: Resource Acquisition Is Initialization

RAII (Resource Acquisition Is Initialization) is a core resource management paradigm in C++, which binds the lifecycle of resources to the lifecycle of objects, thus providing an automatic and safe resource management mechanism. This article will detail this technique from multiple dimensions. 1. Core Principles and Mechanisms The core principle of RAII is based on … Read more

Resource Management in FreeRTOS

Resource Management in FreeRTOS

Resource Management Problem: When a task is using a resource and is preempted before it has finished using it, the resource may be left in an incomplete or corrupted state. If another task or interrupt tries to access this resource at that time, it can lead to data corruption or processing errors. That is why … Read more