memory

std::unique_ptr

A std::unique_ptr manages automatically and exclusively the lifetime of its resource according to the RAII idiom. std::unique_ptr should be your first choice because it does its work without memory or performance overhead.

Read more
Add CommentViews: 5154

Memory and Performance Overhead of Smart Pointers

C++11 offers four different smart pointers. On two of them I will have a closer look in this post regarding memory and performance overhead. My first candidate std::unique_ptr takes exclusively care of the lifetime of one resource; std::shared_ptr shares the ownership of a resource with other std::shared_ptr's. I will state the result of my tests before I show you the raw numbers: There are only few reasons in modern C++ justifying the memory management with new and delete.

 

Read more
Comments 8Views: 21531

Careful Handling of Resources

The careful handling of resources - may it be for example memory, files or sockets - is a key concern of programming in C++. This holds in particular true for the embedded programming that is often characterized by limited resources. Therefore, I will write a few posts about this challenging and versatile topic.

Read more
Add CommentViews: 2343

My Newest E-Books

Latest comments

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 273

All 426404

Currently are 203 guests and no members online