Read only memory and heap memory

AFAIK, string literals are stored in read-only memory in the case of the C language where it is really present on the hardware.

according to my handful of knowledge is in RAM. correct me if I am wrong.

How different is the heap from permanent memory?

OS dependent?

+3
source share
4 answers

This is usually done using hardware.

, . , , . , .

, OS/loader , , , .

- .

+3

. , , . C , rom, ; (Harvard). unix- , , , , ( ).

+1

.

, , . , , ​​. , , , , , , .

0

From the point of view of hw RAM is RAM, and it can be R / W. Read-only memory is an attribute provided by software; on some architecture (almost everything we are used to) there is hardware support to make part of the memory inaccessible for writing (in the sense that when trying to access the address inside this memory an “exception” occurs).

0
source

Source: https://habr.com/ru/post/1749347/


All Articles