lundi 25 mars 2019

What is a memory location?

Surprisingly little information turns up by the search engine. The book C++ Concurrency In Action, in chapter 5 states:

In C++, it's all about objects and memory locations.

Then later,

Whatever its type, an object is stored in one or more memory locations. Each such memory location is either an object (or subobject) of a scalar type such as unsigned short or my_class* or a sequence of adjacent bit fields.

The emphasis is as printed in the book, so clearly a fundamental concept, yet there is no definition.

So, what is it? Is it a universal concept or something more narrowly defined in the C++11 standard? How should I think about it in terms of 32- vs 64-bit architecture and CPU registers? What does it mean that a bit field (or rather, a series of adjacent bit fields of non-zero length) are part of the same memory location? This last statement implies that a memory location can store data of arbitrary length.

Aucun commentaire:

Enregistrer un commentaire