It's well known that inappropriate use of std::shared_ptr can lead to memory leak due to circular reference. In this article, a simple case where circular reference can happen on std::unique_ptr is demonstrated, and the method to avoid it is suggested.
Objects lifetime management is one of the critical elements in C++ development, but corresponding tools for debugging are rather scarce. This article described a non-invasive to track the invocation of ctors and dtors of classes in C++, which is enabled with the decorator pattern.
Placement new is a rarely used feature in C++. This article gives a brief introduction to this feature, and shows how it can be helpful in the implementation of circular linked lists.
Get the pin assignment of a board without destroying it.
The column index of a node in a complete binary tree encodes the path to reach it from the root. A simple and efficient encode/decode scheme can be made upon this result, and facilitate other algorithm implementations.
The column index of a node in a complete binary tree encodes the path to reach it from the root. A simple and efficient encode/decode scheme can be made upon this result, and facilitate other algorithm implementations.
Placement new is a rarely used feature in C++. This article gives a brief introduction to this feature, and shows how it can be helpful in the implementation of circular linked lists.
Objects lifetime management is one of the critical elements in C++ development, but corresponding tools for debugging are rather scarce. This article described a non-invasive to track the invocation of ctors and dtors of classes in C++, which is enabled with the decorator pattern.
Is it possible to take fine-grained control on a program after it being compiled? Directly manipulating the machine code in the binary can be an approach. As impractical as it sounds, this technique can be used to tackle real-world problems, as shown in this article.
A brief summary to the GSoC-2022 Project - thrift for zephyr, which I have contributed to.
Get the pin assignment of a board without destroying it.
Get the pin assignment of a board without destroying it.
Placement new is a rarely used feature in C++. This article gives a brief introduction to this feature, and shows how it can be helpful in the implementation of circular linked lists.
Is it possible to take fine-grained control on a program after it being compiled? Directly manipulating the machine code in the binary can be an approach. As impractical as it sounds, this technique can be used to tackle real-world problems, as shown in this article.
A brief summary to the GSoC-2022 Project - thrift for zephyr, which I have contributed to.