In this chapter, we will step the reader through how to properly and safely perform C++-style memory management, while also adhering to the C++ Core Guidelines whenever possible, leveraging additions to the C++ standard template library in C++11, C++14, and C++17 to increase the safety, reliability, and stability of the reader's system program. We will start by first introducing the new() and delete() functions, and how they may be used to allocate type-safe memory, including aligned memory. Next, this chapter will discuss the safety issues with using new() and delete() directly and how these safety concern may be handled using smart pointers, including their impact on C++ Core Guideline compliance. How to perform memory mapping and permissions will also be discussed, with the chapter concluding with a brief discussion on fragmentation...
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine