Memory

C++ Core Guidelines: Passing Smart Pointers

Passing smart pointers is a critical topic that is seldom addressed. This ends with the C++ core guidelines because they have six rules for passing std::shared_ptr and std::unique_ptr.

Read more
Views: 324955

C++ Core Guidelines: Rules for Smart Pointers

There were a lot of C++ experts who said that smart pointers were the essential feature of C++11. Today, I will write about smart pointers in C++.

Read more
Views: 109785

C++ Core Guidelines: Rules for Allocating and Deallocating

The guidelines have six rules for explicit memory allocation and deallocation. Six! Maybe you are surprised because there is a simple rule in modern C++: don't use new and delete. The story is not so simple.

Read more
Tags: Memory
Views: 43797

C++ Core Guidelines: Rules about Resource Management

This and the following posts will probably be about the most critical concern in programming: resource management. The C++ Core Guidelines have rules for resource management in general but also rules for allocation and deallocation and smart pointers in particular. Today I will begin with the general rules of resource management.

Read more
Tags: Memory
Views: 41552

Memory Pool Allocators by Jonathan Müller

After I have written a few posts about memory management in C++, I'm very glad to present Jonathan Müller, which will write a guest post about his implementation of the memory library. He will explain to us his concepts about his design. Jonathan is known as an expert in memory management in the C++ community. In the  59 episodes, he presented his ideas to a worldwide audience.

Read more
Views: 79199

Pros and Cons of the various Memory Allocation Strategies

In C++ you have the choice between various memory allocation strategies. In addition to the frequently used dynamic memory allocation, you have the stack allocation. But you can preallocate the memory at the start time of your program. This can be a fixed-sized block or one or more memory pools. Each of these strategies has its pros and cons. One, I will answer in this post.

 

Read more
Views: 59022

Strategies for the Allocation of Memory

There are a lot of different strategies for allocating memory. Programming languages like Python or Java request their memory from the heap at runtime. Of course, C or C++ also has a heap but prefers the stack. But these are by far not so only strategies for allocating memory. You can preallocate memory at the program's start time as a fixed block or a pool of memory blocks. This preallocated memory can afterward be used at the runtime of your program. But the critical question is: What are the pros and cons of the various strategies to allocate memory?

Read more
Views: 103576

Memory Management with std::allocator

What is common between all containers of the Standard Template Library? They have a type parameter Allocator that is by default std::allocator. The job of the allocator is to manage the lifetime of its elements. That means allocating and deallocating memory for its elements and initializing and destroying them.

Read more
Views: 88732

Improvements of this Blog

In my post Time for Wishes, I asked: "How can I improved my blog?" And here are the answers.

Read more
Tags: Memory
Views: 10415

Overloading Operator new and delete 2

I overloaded in the last post operator new and delete. Therefore, finding memory leaks and getting the first hint of the bad guys. My solution had two not-so-nice properties. With this post, I will overcome them.

Read more
Views: 37536

Stay Informed about my Mentoring

 

Mentoring

English Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Course: The All-in-One Guide to C++20

Course: Master Software Design Patterns and Architecture in C++

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code

Visitors

Today 4038

Yesterday 4371

Week 39845

Month 169970

All 12057736

Currently are 230 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments