What is the behavior of various systems when you have more than one copy of a specific program or library, do string literals run once in RAM or once for each copy of a process / library? What if they are stored in an array like:
static const char *const foo[] = { "bar", "baz", "buz" };
Does behavior staticchange memory behavior?
static
Edit: since this is probably platform specific, what is the behavior of the Microsoft compiler on Windows or the GCC on Linux (x86)?
, , , , . . , , , . Copy On Write (COW).
, , , , , , .
, , COW.
.
, , . , , , , .
(oxymoron), , , , t , , , .
, , .
?
, .
(, ), . ( , ). , ( ) , "" , . (), . , .
PE . , . , .
static , . , , , , .
Windows , Unix/Linux , , RAM , . . , , , , . ( Win16 , , Win32 )
(, ) ( )
UPDATE: Windows DLL, "shared". , , , .
Source: https://habr.com/ru/post/1765370/More articles:Efficient memory storage and retrieval of categorized string literals in C ++ - c ++The most concise syntax J for creating a numerical matrix is jWebSphere local transaction restriction problem J2CA0086W - jdbcParallelizable jpeg-like compression using only DCT, stages of length coding, is compression / performance possible? - imageПроверка файла CSV - это действительно CSV файл - phpУстановка конечной точки WebServiceWrapper во время выполнения - flexHow to make Android MediaPlayer () stop when the application is closed? - androidCSharpCodeProvider pulls .NET 2.0 assembly from .NET 4.0 application - .netOn pixel lighting in modern GLSL? - graphicsReducing the planning of quantized Boolean formulas - artificial-intelligenceAll Articles