11

CHAPTER

C++ and Memory

CHAPTEROUTLINE —• 11.1 Introduction
—• 11.2 Memory Models
—• 11.3 The new and delete Operators
—• 11.4 Heap Consumption
—• 11.5 Overloading new and delete Operators
—• 11.6 Execution Sequence of Constructors and Destructors
—• 11.7 Specifying Address of an Object
—• 11.8 Dynamic Objects
—• 11.9 Calling Convention

11.1 INTRODUCTION

Memory is one of the critical resources of a computer system. One must be conscious about the memory modules while an application is being developed. In this chapter, we will learn stack, heap, dynamic object, and calling conventions.

11.2 MEMORY MODELS

The memory model sets the supportable size of code and data areas as shown in Figure 11.1. Before compiling and linking ...

Get Object-Oriented Programming with ANSI and Turbo C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.