D
D
dearname2015-06-26 14:56:01
Programming
dearname, 2015-06-26 14:56:01

Is there any classical literature about working with memory, using C or C++ as an example?

Is there any classical literature about working with memory, using C or C++ as an example? That is, how data is stored, how various pointers, links, and so on work.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
abcd0x00, 2015-07-02
@dearname

K&R2
https://en.wikipedia.org/wiki/The_C_Programming_La...
There, in the 8th chapter, the principle of the memory allocation functions is described, and then you also write your own memory manager.
Memory is represented by a linked list of blocks, which are sliced ​​into chunks when allocated and glued into larger blocks when deallocated. (There are other memory managers like Python's.)

V
Vitaly, 2015-06-26
@vt4a2h

Here it is: rus-linux.net/lib.php?name=/MyLDP/hard/memory/memo... (there are examples in C, if I remember correctly).
And then any textbook on C++ or K&R on C.

L
leventov, 2015-06-28
@leventov

It is not very clear what exactly you mean by "how data is stored" and "how memory is arranged, how to handle it." I would venture to advise you to read about the arrangement of memory allocators, stack (si-runtime), memory subsystems in Linux (mm). After that, hardly anything can scare you.
Where to watch it - the second question. Books in my opinion are too general and usually outdated. The quality and depth of the explanation is also not always excellent. Google better relatively recent articles with good reviews

S
Spetros, 2015-06-26
@Spetros

Of course there is, almost any "classic" textbook will do.

M
maaGames, 2015-06-26
@maaGames

Richter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question