Welcome to www.ebook-x.com. Download popular free ebooks, classical free ebooks, new releases and more.

The best Ebooks library for Free Ebooks Download.

Free ebooks Free programing ebooks C/C++ Memory As A Programming Concept In C And C++

Memory As A Programming Concept In C And C++

Memory As A Programming Concept In C And C++The ebook is divided into eleven chapters. Chapter 2 deals with the process of compilation, linking, and loading in order to explain how the behavior of programs can be discussed and examined as if they were executing in the source form, how the static and the dynamic parts of memory are assigned to a program, and how the abstract address space of the program is mapped to the physical memory. Most of the topics in Chapter 2 are drawn from the field of the principles of operating systems. We cover the topics without referring to any particular operating system or any low-level technical details. Otherwise, the text would become cumbersome and difficult to read and would distract the reader from focusing on memory and its role in C/C++ programming. However, knowledge of the topics covered in Chapter 2 is essential to almost all discussions of the role of memory in the subsequent chapters.
Chapter 3 deals with variables as memory segments (data containers) and the related notions of addresses and pointers, with a particular emphasis on various interpretations of the contents of memory segments and possible memory access errors. In Chapter 4, dynamic memory allocation and deallocation are discussed and illustrated using the C allocators malloc(), calloc(), and realloc() and the C deallocator free(). In Chapter 5, function calls are explained with a detailed look at activation frames, the system stack, and the related notion of recursion. In Chapter 6, one-dimensional arrays and strings, both static and dynamic, are discussed. Chapter 7 extends that discussion to multi-dimensional arrays.
Chapter 8 examines in detail the construction and destruction of C++ objects together with the C++ allocators and the C++ deallocators (the operators delete and delete[]) in their global and class-specific forms. The focus of the chapter is not the object orientation of C++ classes but rather the aspects of object creation and destruction related to memory. Similarly, in Chapter 9 we discuss linked data structures but not from the usual point of view; instead, our point of view is related to memory (i.e., how to move linked data structures in memory, to or from a disk, or across a communication channel). Chapter 10 is devoted to a classification of the most frequent problems leading to memory leaks and their detection and remedy for both C and C++ programs.
We started our discussion with operating system topics related to programs - compilation, linking, and loading - in Chapter 2, and in Chapter 11 we finish our book by again discussing operating system topics related to programs in execution: processes and threads, and how they relate to memory. Of course, this chapter must be more operating system-specific, so some notions are specific to UNIX.
Finally, in the appendices we present some complete code and discuss it briefly. In Appendix A we describe the Hanoi towers puzzle and provide a simple C program solving it. In Appendix B we present a simple C++ program on which we illustrate object tracing: how to keep track of objects and of when and where they were allocated. We go through various combinations of turning the features on and off. In Appendix C, a similar C++ program is used and object tracing, localization tracing, and memory allocation tracing are all demonstrated. Appendix B and Appendix C both illustrate debugging of memory leaks as discussed in Chapter 10. Finally, Appendix D contains process-safe and thread-safe UNIX logging functions that serve to illustrate some of the topics related to processes and threads discussed in Chapter 11.
Download free ebooks of c++:Memory As A Programming Concept In C And C++
 
More free ebooks
 
Joomla 1.5 Templates by Joomlashack