{"id":431360,"date":"2024-09-05T21:00:30","date_gmt":"2024-09-05T21:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=431360"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=431360","title":{"rendered":"<span>\u0421\u0442\u0440\u043e\u043a\u0438 \u0432 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b06\/ddf\/3b7\/b06ddf3b7511d2d79123e0f48dcc3c39.png\" width=\"686\" height=\"386\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b06\/ddf\/3b7\/b06ddf3b7511d2d79123e0f48dcc3c39.png\"\/><\/figure>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0431\u044b\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e\u0435, \u043a\u0440\u043e\u043c\u0435, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e, \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0433\u0434\u0435 \u0431\u044b\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0447\u0435\u0433\u043e-\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 ASCII \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041d\u043e, \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0434\u0430\u0436\u0435 \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u043c\u0443\u0434\u0440\u044f\u043b\u0438\u0441\u044c \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 200 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0431\u043e\u0440\u0430 ASCII, \u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u0438\u0433\u0440\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438, \u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u0435\u0441\u0442\u044c \u0442\u0443\u0442 \u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430, \u0441\u0442\u0430\u0440\u0430\u043d\u0438\u044f\u043c\u0438 Sony \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0445, \u0435\u0449\u0435 \u0434\u043e 20 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0433\u0440 \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 ASCII \u043d\u0430 PS1 \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Unicode (ISO 10646), \u0441 \u0432\u044b\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0434\u043a \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u043e\u0439\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 UTF-16 \u0438 UTF-32, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 PS3 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 UTF-8.  <\/p>\n<pre><code class=\"cpp\">int main() {   char     c1{ 'a' };       \/\/ 'narrow' char   char8_t  c2{ u8'a' };     \/\/ UTF-8  - (PS3 and later)   char16_t c3{ u'\u8c93' };     \/\/ UTF-16 - (PS2)   char32_t c4{ U'????' };   \/\/ UTF-32 - (PS2 limited)   wchar_t  c5{ L'\u03b2' };      \/\/ wide char - wchar_t }<\/code><\/pre>\n<h3>C-Style \u0441\u0442\u0440\u043e\u043a\u0438 (NTBS)<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/257\/865\/96d\/25786596de4ed63bc09a63b3bf411632.png\" width=\"766\" height=\"344\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/257\/865\/96d\/25786596de4ed63bc09a63b3bf411632.png\"\/><\/figure>\n<p>\u041b\u044e\u0431\u0430\u044f \u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c (NTBS), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0430\u0439\u0442\u043e\u0432 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u043c &#8216;\\0&#8217;).<\/p>\n<p><strong>\u0414\u043b\u0438\u043d\u0430 NTBS<\/strong> \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0435\u043c\u0443 \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443. \u041f\u0443\u0441\u0442\u0430\u044f NTBS \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u043d\u043e\u043b\u044c.<\/p>\n<p><strong>\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b<\/strong>  \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0434\u0432\u043e\u0439\u043d\u044b\u043c\u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 (&#187; &#171;).<\/p>\n<pre><code class=\"cpp\">int main(void) {   char string_literal[] = \"Hello World\";         std::cout &lt;&lt; sizeof(string_literal) &lt;&lt; '\\n';  \/\/ 12   std::cout &lt;&lt; strlen(string_literal) &lt;&lt; '\\n';  \/\/ 11 }<\/code><\/pre>\n<p>\u0412 C\/C++ \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (&#8216;) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u041e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (&#8216; &#8216;) \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a, \u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0435 SDK \u043e\u0442 Sony \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u044d\u0442\u0443 \u0436\u0435 \u0440\u043e\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u0441\u0438\u043c\u0432\u043e\u043b &#8216;`&#8217; (&#171;\u0433\u0440\u0430\u0432\u0438\u0441&#187; \u0438\u043b\u0438 &#171;backtick&#187;), \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u043b \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u043b\u0438\u0436\u0435 \u043a \u043d\u0430\u0447\u0430\u043b\u0443  &#171;.rodata&#187;, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 exe, \u0447\u0442\u043e \u0438\u043c\u0435\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.    <\/p>\n<pre><code class=\"cpp\">char string_literal[] = `Hello World`;  \/\/ \u0442\u043e\u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 rodata char another_string_literal[] = 'Hello World'; \/\/ \u0442\u0430\u043a \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e<\/code><\/pre>\n<h3>C-\u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/h3>\n<p>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a?  (<a href=\"https:\/\/godbolt.org\/z\/xT3b7TdPf\" rel=\"noopener noreferrer nofollow\">godbolt<\/a>)<\/p>\n<pre><code class=\"cpp\"> int main() {    char message[] = \"this is a string\";    printf(\"%u\\n\", sizeof(message));     const char *msg_ptr = \"this is a string\";    printf(\"%u\", sizeof(msg_ptr)); }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"assembly\">main:         push    rbp         mov     rbp, rsp         sub     rsp, 48         mov     rax, qword ptr [rip + .L__const.main.message]         mov     qword ptr [rbp - 32], rax         mov     rax, qword ptr [rip + .L__const.main.message+8]         mov     qword ptr [rbp - 24], rax         mov     al, byte ptr [rip + .L__const.main.message+16]         mov     byte ptr [rbp - 16], al         lea     rdi, [rip + .L.str]         mov     esi, 17         mov     al, 0         call    printf@PLT         lea     rax, [rip + .L.str.1]         mov     qword ptr [rbp - 40], rax         lea     rdi, [rip + .L.str.2]         mov     esi, 8         mov     al, 0         call    printf@PLT         xor     eax, eax         add     rsp, 48         pop     rbp         ret  .L__const.main.message:         .asciz  \"this is a string\"  .L.str:         .asciz  \"%u\\n\"  .L.str.1:         .asciz  \"this is a string\"  .L.str.2:         .asciz  \"%u\"<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 17, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b). \u0412\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f.  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f <code>message<\/code> \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. <\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f <code>msg_ptr<\/code> \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 <code>.rodata<\/code>, \u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043e\u0442 \u0442\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u0441 \u0433\u0440\u0430\u0432\u0438\u0441\u043e\u043c \u0431\u044b\u043b\u043e, \u0447\u0442\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 &#171;\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u043b\u0438\u0441\u044c&#187; \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0442\u043e\u0440\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u044d\u0442\u0443 \u0441\u0435\u043a\u0446\u0438\u044e, \u0447\u0435\u043c \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0431\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0441\u0435\u0439\u0432\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Nintendo \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u0435\u043b\u043e Sony, \u0432 \u043f\u043b\u0430\u043d\u0435 \u043f\u043e\u0434\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0435\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u0434\u043a (\u0441 2018 \u0433\u043e\u0434\u0430) \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0430 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<h3>C String Standard Library<\/h3>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e SDK \u0432\u0435\u043d\u0434\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 <code>&lt;string.h&gt;<\/code>, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 strcpy\/strlen. \u041d\u0443 \u0432\u0441\u0435 \u043a\u0440\u043e\u043c\u0435 Sony. \u0414\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 clang, \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0435 SDK \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043b\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438 \u0443\u0436\u0435 \u0438\u043c\u0435\u043b\u0438 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u041c\u0430\u0439\u043a\u0440\u043e\u0441\u043e\u0444\u0442, \u043a\u0441\u0442\u0430\u0442\u0438 \u0442\u0430\u043a\u0438\u043c \u043d\u0430\u043f\u043b\u0435\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u043b \u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0430\u043c\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u0445 SDK \u0434\u043b\u044f xbox.<\/p>\n<pre><code class=\"cpp\">copying strings         : strcpy, strncpy, strdup concatenating strings   : strcat, strncat, strappend comparing strings       : strcmp, strncmp parsing strings         : strcspn, strstr, strchr, strchrrev, strupper... tokenize                : strtok, strsplit length                  : strlen, strempty<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0442\u043e\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 NTBS. \u0423 Sony \u0431\u044b\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438\u0441\u044c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0430\u0439\u0442, \u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u0438 \u0431\u043b\u043e\u043a\u0438 \u0431\u044b\u043b\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 4 \u0438 5 \u0432\u0435\u0440\u0441\u0438\u0439 \u0421\u0414\u041a \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u0448\u043b\u0438, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u041f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0442\u0430\u043a\u0438\u0445 \u0438\u0437\u044b\u0441\u043a\u043e\u0432 \u0431\u044b\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0435 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u0437\u043b\u043e\u043c\u044b \u0432 <strong>PS3 Fat<\/strong> \u0438 <strong>PS3 Slim<\/strong>.<\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0441\u0430\u043c\u0430\u044f \u0448\u0438\u0440\u043e\u043a\u0430\u044f, \u043b\u044e\u0431\u043e\u0439 \u0441\u043e\u0444\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u0412 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043c\u0430\u043b\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d \u0432 \u0441\u0438\u043b\u0443 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0443\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c\u0438.<\/p>\n<\/blockquote>\n<h4>C++ \u0441\u0442\u0440\u043e\u043a\u0438<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c32\/38e\/af2\/c3238eaf24c401b84a48c64ed37bf7ce.png\" width=\"1904\" height=\"1251\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c32\/38e\/af2\/c3238eaf24c401b84a48c64ed37bf7ce.png\"\/><\/figure>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>&lt;string&gt;<\/code>. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f <code>std::string<\/code> \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043c\u0438 \u2014\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432, \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e, \u043f\u043e\u0438\u0441\u043a \u0438 \u0442. \u0434., \u0447\u0442\u043e \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u0441\u0442\u0440\u043e\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c C-c\u0442\u0440\u043e\u043a, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u041e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0435\u043c\u0443, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<pre><code class=\"cpp\">const std::string this_string { \"This is\" }; \/\/ initialise  int main() {   std::string name = \" string\";     std::string concat_str =  this_string + name; \/\/ concatenation    std::cout &lt;&lt; concat_str;    if (!this_string.empty()) {     std::cout &lt;&lt; '\\n' &lt;&lt; this_string.length() &lt;&lt; '\\n';     std::cout &lt;&lt; this_string[0] &lt;&lt; ' ' &lt;&lt; this_string.front() &lt;&lt; '\\n';     std::cout &lt;&lt; this_string[this_string.length()-1] &lt;&lt; ' ' &lt;&lt; concat_str.back() &lt;&lt; '\\n';   } }  &lt;&lt;&lt;&lt;&lt;&lt; This is string 7 T T s g<\/code><\/pre>\n<p><code>std::string<\/code> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <code>const char*<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0435 data \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f. \u0410 \u043c\u043d\u043e\u0433\u0438\u0435 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435) \u0441\u0434\u043a \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0442\u0443\u043b\u0437\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0421-API, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>std::string<\/code> \u0432 <code>const char*<\/code>. C-API \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0432\u044b\u0431\u0440\u0430\u043d \u043d\u0435 \u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0436\u0438\u0437\u043d\u0438, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ABI \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043d\u0434\u043e\u0440\u0430\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438, \u043d\u043e \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0430\u0436\u0435 \u043c\u0438\u043d\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043a\u0430\u043a \u044d\u0442\u043e \u043b\u044e\u0431\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c Nintendo, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u043e\u043c\u0430\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 SDK. \u0418 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u043d\u0434\u043b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e firmware, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435.<\/p>\n<p>\u0423 <code>std::string<\/code> \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>.c_str()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0441\u0442\u0438\u043b\u0435 C (<code>const char*<\/code>). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <code>std::string<\/code>, \u043a\u0430\u043a \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <code>.data()<\/code> \u0438\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>std::data()<\/code>.  <\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e, \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437-\u0437\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/blockquote>\n<h3>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h3>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>std::string<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 <code>::new<\/code> \u0438 <code>::delete<\/code> \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043a\u0443\u0447\u0435, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c (NTBS).  <\/p>\n<pre><code class=\"cpp\">int main() {     const char* this_is_ro_string = \"literal string\";    \/\/ stored in .rodata     char this_is_stack_string[] = \"literal string\";      \/\/ stored on stack     std::string this_is_heap_string = \"Literal String\";  \/\/ stored in .heap  }<\/code><\/pre>\n<p><code>std::strings<\/code>\u00a0\u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">class string {   data\u00a0-&gt; \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437\u00a0.data()   length\u00a0-&gt; \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u0435\u0442\u0443\/\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445             \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437\u00a0.length()\u00a0or\u00a0.size()   capacity\u00a0-&gt; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 ( &gt;= length); \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437\u00a0.capacity() }<\/code><\/pre>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 SDK \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0438\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0443\u043b\u043e\u043c \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0432 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0435\u043d\u0434\u043e\u0440\u0430. \u042d\u0442\u043e \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u0440\u043e\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h3>Short String Optimisation (SSO)<\/h3>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Clang) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e &#8212; \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (Short-String Optimisation, SSO). \u041a\u043b\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0430 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u0442\u0430\u043c, \u043f\u043e\u043c\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0435\u0449\u0435 CRC \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043f\u0443\u043b \u0438\u043b\u0438 \u0431\u0443\u0444\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<pre><code class=\"cpp\">class string {   void *data; \/\/ 8bytes   size_t size; \/\/ 8bytes   size_t capacity; \/\/ 8Bytes   size_t crc;  \/\/ 8bytes }<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043e\u0431\u044c\u0435\u043c \u044d\u0442\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043d\u0438\u0436\u0430\u044e\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>std::string<\/code>. \u0427\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0447\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 (\u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u043c\u043e\u0436\u0435\u0442, \u0438\u0431\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438) \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0441\u0442\u0435\u043a\u0430, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438, \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043a\u0443\u0447\u0435.<\/p>\n<h3>C++17 std::string_view<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/515\/7de\/20a\/5157de20a697f9d0a1e9d09ee47c0fc7.png\" width=\"800\" height=\"416\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/515\/7de\/20a\/5157de20a697f9d0a1e9d09ee47c0fc7.png\"\/><\/figure>\n<p>C++17 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 <code>std::string_view<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443, \u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u0445\u043e\u0436\u0438\u0445 \u043d\u0430 <code>char<\/code>.  \u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>std::string_view<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u0447\u043b\u0435\u043d\u0430: \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0442\u0438\u043f \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440. \u0418 \u0445\u043e\u0442\u044f \u044d\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b NTBS \u0441\u0442\u0440\u043e\u043a, <code>std::string_view<\/code> \u0432 C++17 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0443\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 \u0441\u0442\u0438\u043b\u0435 C.<\/p>\n<pre><code class=\"cpp\">template&lt;class _CharT, class _Traits = char_traits&lt;_CharT&gt; &gt; class string_view { public:     typedef _CharT value_type;     typedef size_t size_type;     ... private:     const value_type* __data;     size_type __size; };<\/code><\/pre>\n<p> <code>std::string_view<\/code> \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043b\u0435\u0433\u0430\u0441\u0438 \u043a\u043e\u0434\u0430 (\u0433\u0434\u0435 \u044d\u0442\u043e \u0443\u043c\u0435\u0441\u0442\u043d\u043e), \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0438\u043f\u0430 <code>const char*<\/code> \u0438 <code>const std::string&amp;<\/code> \u043d\u0430 <code>std::string_view<\/code>, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438\u0441\u0443\u0449\u0438\u0435 NTBS \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0434\u0435\u043b\u0438\u0441\u044c, \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0430\u0440\u043e\u0447\u043a\u0430 \u043d\u043e\u0432\u044b\u0445:<\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0427\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432, \u0438 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043d\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u0441\u0432\u043e\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0432\u0441\u0435\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u0434\u0432\u0438\u0436\u043a\u0430.<\/p>\n<\/blockquote>\n<h3>string lifetime management<\/h3>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435\u0441\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b <code>std::string_view<\/code> \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u043b \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0432\u0441\u0435 \u0442\u043e\u0442 \u0436\u0435 \u043f\u043e\u0438\u043d\u0442\u0435\u0440, \u043f\u0443\u0441\u0442\u044c \u0438 \u0432 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0435. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0441\u043e\u0431\u043e \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u0432 \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c (<a href=\"https:\/\/godbolt.org\/z\/fxY6xfc11\" rel=\"noopener noreferrer nofollow\">godbolt<\/a>).  \u041d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044f\u0445, \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0430\u0433\u0438 \u0441 \u043f\u043e\u0432\u0438\u0441\u0448\u0438\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0440\u044f\u0434 \u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0442\u0440\u0443\u0434\u043d\u043e\u0432\u044b\u044f\u0432\u043b\u044f\u0435\u043c\u044b\u043c \u0431\u0430\u0433\u0430\u043c. \u0415\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0443\u0441\u043f\u0435\u043b\u0438 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u0442\u0430\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0430.<\/p>\n<pre><code class=\"cpp\">using namespace std::string_literals; \/\/ operator\"\"s using namespace std::literals;        \/\/ operator\"\"sv  int main() {      \/\/ OK: \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0433\u0434\u0435\u0442\u043e \u0432 .rodata   std::string_view ntbs{ \"a string literal\" };         \/\/ UB: rvalue \u0441\u0442\u0440\u043e\u043a\u0430 \u0430\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0430\u044f \u043d\u0430 \u043a\u0443\u0447\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432 \u0441\u043a\u043e\u043f\u0435   std::string_view heap_string{ \"a temporary string\"s };    \/\/ \u0434\u0435\u0430\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443   std::cout &lt;&lt; \"Address of heap_string: \" &lt;&lt; (void*)heap_string.data() &lt;&lt; '\\n';    std::cout &lt;&lt; \"Data at heap_string: \" &lt;&lt; heap_string.data() &lt;&lt; '\\n'; }<\/code><\/pre>\n<h3>non null-terminated strings<\/h3>\n<p> \u0412\u0442\u043e\u0440\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>string::data()<\/code> \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432, <code>string_view::data()<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u0443\u0444\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <code>data()<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>const charT*<\/code> \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043d\u0443\u043b\u0435\u043c, \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. <code>std::string_view<\/code> \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c (NTBS), \u0438\u043b\u0438 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u043e\u043e\u0431\u0449\u0435:<\/p>\n<pre><code class=\"cpp\">void sv_print(std::string_view str) {   std::cout &lt;&lt; str.length() &lt;&lt; ' '&lt;&lt; reinterpret_cast&lt;const void*&gt;(str.data()) &lt;&lt; '\\n';   std::cout &lt;&lt; \"cout: \" &lt;&lt; str &lt;&lt; '\\n';     \/\/ based on str.length()   printf(\"stdout: %s\\n\",str.data());        \/\/ based on NUL }  int main() {     std::string      str_s  {\"godbolt compiler explorer\"};      std::string_view str_sv {\"godbolt compiler explorer\"};      char char_arr2[] = {         'a',' ','c','h','a','r',' ','a','r','r','a','y'         }; \/\/ Not null character terminated    sv_print(str_s.substr(8,8));    sv_print(str_sv.substr(8,8));    sv_print(char_arr2); }  &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;    8 0x7ffff4bf1550 cout: compiler stdout: compiler  8 0x40201f cout: compiler stdout: compiler explorer  16 0x7ffff4bf1514 cout: a char array\ufffd\ufffd\ufffd stdout: a char array\ufffd\ufffd\ufffd<\/code><\/pre>\n<h3>Sized String<\/h3>\n<p>\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0445\u0443\u0434\u0448\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u0434\u0440\u0443\u0433 \u0440\u0435\u0448\u0430\u0435\u0442\u0435 \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0433\u0440\u0443\/\u0434\u0432\u0438\u0436\u043e\u043a \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043b\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443, \u0433\u0434\u0435 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0431\u0435\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u0430, \u0438 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e OOM \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0435\u0431\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0432\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0438, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0435\u0448\u0435 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 200. \u0422\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0443\u0434\u0430 \u043f\u043e\u0434\u0435\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0430 \u0432\u0441\u044f \u0432 \u043c\u0435\u043b\u043a\u0443\u044e \u0434\u044b\u0440\u043e\u0447\u043a\u0443, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 200\u041c\u0431 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442. \u0422\u0443\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 <strong>inplace<\/strong> \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044c \u0438 \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430, \u0437\u0430\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435, \u043d\u0435 \u0430\u043b\u043e\u0446\u0438\u0440\u0443\u044e\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043a\u0435\u0448\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043f\u043e\u043b\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/dalerank\/Akhenaten\/blob\/master\/src\/core\/bstring.h\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>, \u043d\u0443 \u0438\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e, \u0438\u0445 \u0442\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e<\/p>\n<pre><code class=\"cpp\">template &lt;size_t _size&gt; class string_sz {     using ref = bstring&lt;_size&gt;&amp;;     using const_ref = const sized_string&lt;_size&gt;&amp;;  protected:     char _data[_size];     ... };<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0433\u043e \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a, \u0447\u0442\u043e \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0434\u0430\u0436\u0435 \u0432 \u043c\u0438\u043d\u0438\u0434\u0430\u043c\u043f\u0430\u0445, \u0438 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u043a\u0443\u0447\u0435 \u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0438\u043d\u0442\u0435\u0440.<\/p>\n<pre><code class=\"cpp\">template&lt;size_t _size&gt; using string_sz = std::string&lt;char, static_allocator&lt;char, _size&gt;&gt;; using string_sz64 = string_sz&lt;64&gt;;<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0421\u0430\u043c\u0430\u044f \u0448\u0438\u0440\u043e\u043a\u0430\u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0438\u0437 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441\u0442\u0440\u043e\u043a. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 string \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c, \u043e\u0442\u0447\u0435\u0433\u043e \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043b\u043e\u0433\u0438, \u0438\u0437\u0437\u0430 \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<\/blockquote>\n<h3>Short Live String<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0432 \u0434\u0432\u0438\u0436\u043a\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0439, \u0442\u043e \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435, \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u0441\u0442\u0440\u043e\u043a, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0445 \u0435\u0449\u0435 \u043d\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0438 \u043d\u0430 Sized String \u0438\u043b\u0438 Hybrid String \u0436\u0438\u0432\u0443\u0442 \u043d\u0435 \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u0440\u044b \u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u0430 \u0442\u043e \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u043c\u0435\u044e\u0442 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0430. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u043e-\u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0434\u044b\u0440\u044f\u0432\u044f\u0442 \u043f\u0430\u043c\u044f\u0442\u044c, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u043d\u0435\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0435\u0441\u0442\u0430 \u043f\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0435. \u0420\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0434\u0432\u0443\u043c\u044f \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a, \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u044b \u0432 \u043d\u0435\u043c \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0430 \u0435\u0441\u043b\u0438 \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0436\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0444\u0435\u0440. \u0412\u0430\u0436\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c. <\/p>\n<pre><code class=\"cpp\">using string_sl = std::string&lt;char, custom_allocator&lt;char&gt;&gt;;<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0420\u0430\u0437\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0447\u0430\u0441\u0442\u0438 \u0434\u0432\u0438\u0436\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u044f, \u043d\u043e \u0437\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043e\u0440\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<\/blockquote>\n<h3>One[N] Frame String<\/h3>\n<p>\u0418 \u0432\u0442\u043e\u0440\u043e\u0439 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u041e\u0441\u043e\u0431\u043d\u044f\u043a\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0432\u0435\u0440\u0445\u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u0440\u0435\u043d\u0434\u0435\u0440\u0435. \u0414\u0430, \u0442\u0430\u043c \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u044b, \u043d\u043e \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f. \u0421\u0443\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0431\u0443\u0444\u0435\u0440\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0440\u0435\u0439\u043c\u0430 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0436\u0434\u044b\u0435 N \u0444\u0440\u0435\u0439\u043c\u043e\u0432, \u0442\u0430\u043a\u043e\u0439 \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0443\u043c\u0435\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0431\u043b\u043e\u043a\u0430 \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u044e\u0442 \u0435\u0433\u043e \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0440\u0435\u0434\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u043d\u043e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f.<\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0440\u0435\u043d\u0434\u0435\u0440, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0412\u043e\u043e\u0431\u0449\u0435\u043c \u0432\u0441\u0435 \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b.<\/p>\n<\/blockquote>\n<h3>Pool String<\/h3>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0438\u0434\u0435\u0438 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0440\u0430\u043d\u0434\u043e\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438, \u0445\u043e\u0442\u044f \u0431\u044b, \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0439 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0439, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u043b\u043e\u043a\u0430\u0446\u0438\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a. \u041d\u043e \u0442\u0430\u043a\u0438\u0435 \u043f\u0443\u043b\u044b \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0445\u043e\u0442\u044c \u0438 \u0432 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441\u0442\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Slab_allocation\" rel=\"noopener noreferrer nofollow\">slab \u0438\u043b\u0438 arena <\/a>\u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0422\u0430\u043a\u0438\u0435 Arena Pool String \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442 \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0443 \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u043c\u0438 \u043a\u0443\u0441\u043a\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e 64 \u0431\u0430\u0439\u0442\u0430, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e 2. \u041d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u0440\u0435\u043d\u044b, \u0441 \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u043f\u043e 32 \u0431\u0430\u0439\u0442\u0430. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f  \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f &#171;\u0441\u0438\u043d\u0435\u0433\u043e&#187; \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430, \u043d\u0430 \u0442\u043e\u043c \u0436\u0435 \u043c\u0435\u0441\u0442\u0435, \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u0435\u0441\u043b\u0438 \u0431\u044b \u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee7\/974\/c56\/ee7974c56a9c2fe6b77456af4bfc303a.png\" width=\"351\" height=\"204\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee7\/974\/c56\/ee7974c56a9c2fe6b77456af4bfc303a.png\"\/><\/figure>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u043b\u043e\u043a, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0443\u043b\u0430, \u0430 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0436\u0438\u0432\u0443\u0449\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0431\u043b\u043e\u043a\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u043f\u0443\u043b\u043e\u0432 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0440\u0435\u043b\u0438\u0437\u043e\u043c \u043f\u043e\u0440\u0435\u0437\u0430\u0442\u044c \u0438\u0445 \u0434\u043e \u043d\u0443\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b \u0432 \u0440\u0430\u0439\u043e\u043d\u043a 90-95%. \u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0443\u043b\u043e\u0432 \u0441\u0442\u0440\u043e\u043a, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 <strong>thread local<\/strong>, \u0433\u0434\u0435 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0438\u043b\u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430, \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0432\u044f\u0437\u0430\u0432 \u0438\u0445 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0442\u0440\u0435\u0434\u043e\u043c \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0432 \u043f\u043e\u0442\u043e\u043a\u0430\u0445, \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/blockquote>\n<h3>Hybrid String<\/h3>\n<p>\u041a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438, \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0433\u0438\u0431\u0440\u0438\u0434\u043d\u044b\u0439 (pmr) \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u043b \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430. \u041e\u043f\u0440\u0430\u0432\u0434\u0430\u043d \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043c\u0435\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u0438\u043c\u0435\u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0418\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0436 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0440\u0430\u0437\u043c\u0435\u0440\u0430. \u0422\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 160 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0438 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 70, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u043e\u0442\u0435\u0440\u0438 \u043d\u0430 \u043f\u0443\u0441\u0442\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u0445 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 15% \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0443\u0444\u0435\u0440\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 128 \u0431\u0430\u0439\u0442 (\u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0438\u043c\u0435\u043d \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Metro Exodus).<\/p>\n<h3>Shared String<\/h3>\n<p>\u0415\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043c\u0435\u043d \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432: \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439, \u0442\u0435\u0433\u043e\u0432, \u0438\u043c\u0435\u043d \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u043b\u044e\u0431\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043f\u0443\u0441\u0442\u0443\u044e \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c. \u0414\u0435\u0441\u044f\u0442\u044c, \u0441\u0442\u043e \u0438 \u0434\u0430\u0436\u0435 \u0442\u044b\u0441\u044f\u0447\u0430 \u043a\u043e\u043f\u0438\u0439 \u0442\u0435\u0433\u0430 &#171;velocity&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0442\u043d\u044f\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u0440\u044f\u0434\u043b\u0438 \u043a\u043e\u043c\u0443 \u0442\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u042d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/String_interning\" rel=\"noopener noreferrer nofollow\">string interning<\/a>, \u0440\u0435\u0448\u0430\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0433\u0440, \u043d\u043e \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c \u0438 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418 \u043f\u0443\u0441\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u00a0\u2014 \u044d\u0442\u043e\u00a0\u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043f\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u0443\u0436\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u043c\u0435\u043c\u043e\u0440\u0438 \u0442\u0440\u0435\u043a\u0435\u0440\u0435. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 <strong>shared string<\/strong> \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u043e\u0432\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0410 \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432 \u044f\u0437\u044b\u043a\u0430\u0445 \u0441\u043e\u00a0\u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u043c\u0443\u0441\u043e\u0440\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u00a0<code>a=b<\/code>\u00a0\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c shared string \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/dalerank\/Akhenaten\/blob\/master\/src\/core\/xstring.h\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442<\/a> <\/p>\n<pre><code class=\"cpp\">class string_shared {    shared_value* _p; };  inline bool operator==(xstring const&amp; a, xstring const&amp; b) {   return a._p == b._p; }<\/code><\/pre>\n<p>\u0438 \u0442\u043e\u0433\u0434\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0443\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u043c\u0435\u0447\u0442\u0430 \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0435\u0440\u0430 (tag &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438), \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u043e\u0432, \u0430 \u043d\u0435 \u0441\u0442\u0440\u043e\u043a. <\/p>\n<pre><code class=\"cpp\">void npc::on_event(const time_tag &amp;tt) { if (tt.tag == event_step_left) { on_step(e_step_left); } else if (tt.tag == event_step_right) { on_step(e_step_right); } else if (tt.tag == event_step_left_hand) { on_step(e_step_left_hand); } else if (tt.tag == event_step_right_hand) { on_step(e_step_right_hand); } else if (tt.tag == event_jump_left) { on_step(e_jump_left); } else if (tt.tag == event_jump_right) { on_step(e_jump_right);     .... }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u0435\u0433\u0438, \u043c\u0430\u0440\u043a\u0435\u0440\u044b \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u0432\u0441\u0435 \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u0434\u0432\u0438\u0436\u043a\u0443 \u0432\u0430\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u0442\u0435\u043a\u0441\u0442 \u0431\u044b\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c. \u041d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432, \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0432\u0438\u0434\u0430 &#171;Object%X_Property%Y_%Z&#187;.<\/p>\n<\/blockquote>\n<h3>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b<\/h3>\n<p>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 <strong>shared string <\/strong>\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438-\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b, \u0442\u0435\u0436\u0435 \u0442\u0435\u0433\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0438\u043c\u044f. \u0418\u043c\u044f \u0442\u0435\u0433\u0430, \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f, \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u0430\u044f \u043b\u044e\u0434\u044c\u043c\u0438 \u043c\u0435\u0442\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438\u043b\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u043e \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 <strong>&#171;animation_tag&#187;<\/strong> \u0438 \u0447\u0438\u0441\u043b\u043e\u043c 1 \u043d\u0435\u0442, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0435\u0441\u043b\u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0432\u0438\u0436\u043a\u0430 \u0438\u043b\u0438 \u0438\u0433\u0440\u044b, \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0438\u0433\u0440\u0435 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f, \u0430 \u0432 \u0442\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0433\u0434\u0435 \u0431\u044b\u043b\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0448\u0438\u0444\u0440\u0443\u044e\u0442\u0441\u044f \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u0431\u0438\u043b\u0434\u0430.<\/p>\n<pre><code class=\"cpp\">struct string_key {   int id; #ifdef EDITOR   const char *str; #endif }  string_key animation_tag{1, \"animation_tag\"};  if (animation.tag == animation_tag) {   ... }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u041c\u0430\u0440\u043a\u0435\u0440\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u0438\u043f\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0432 \u043a\u043e\u043c\u043f\u0430\u0439\u043b \u0442\u0430\u0439\u043c\u0435 \u0438\u043b\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432.<\/p>\n<\/blockquote>\n<h3>Simd Strings<\/h3>\n<p>\u041d\u043e \u0438 \u044d\u0442\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442, \u0442\u043e\u0433\u0434\u0430 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0438\u0437\u044b\u0441\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 sse \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0435\u0439, \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043b\u0435\u0436\u0430\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 lua\/js\/per \u0442\u0430\u0431\u043b\u0438\u0446. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0430 108\u041c\u0431 \u043b\u0443\u0430\u0448\u043d\u0438\u043a\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2\u043c\u0438\u043d\u0443\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u0430 \u043d\u0435 \u0441\u0430\u043c\u043e\u043c \u0441\u043b\u0430\u0431\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435. \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c 80% \u043c\u043e\u0449\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c SIMD-\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>strstr<\/code> \u0438 <code>strchr<\/code>.   \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435, \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u043d\u0430\u0434\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"137\" width=\"137\">\n<p align=\"left\"><code>strstr<\/code>\u00a0x86:<br \/>\u00a0<strong>2.0<\/strong>\u00a0GB\/s<\/p>\n<\/td>\n<td data-colwidth=\"163\" width=\"163\">\n<p align=\"left\"><code>string.find<\/code>x86:\u00a0<strong>1.6<\/strong>\u00a0GB\/s<\/p>\n<\/td>\n<td data-colwidth=\"256\" width=\"256\">\n<p align=\"left\"><code>boost.string.find<\/code>x86: 1<strong>.3<\/strong>\u00a0GB\/s<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>simd.find<\/code>x86:<br \/>\u00a0<strong>10.1<\/strong>\u00a0GB\/s<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u0433\u043e\u0440\u044f\u0447\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u0432\u0440\u043e\u0434\u0435 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0448\u0435\u0439\u0434\u0435\u0440\u043e\u0432.<\/p>\n<\/blockquote>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/02a\/0bf\/8d9\/02a0bf8d9ff05b8a7ae21b2a34c17a07.png\" width=\"2000\" height=\"1335\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02a\/0bf\/8d9\/02a0bf8d9ff05b8a7ae21b2a34c17a07.png\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u0432\u0441\u0451, \u0447\u0442\u043e \u044f \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a<\/p>\n<p>.<\/p>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u0431\u043e\u0433\u0430\u0442\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, <code>std::string<\/code> \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u043e\u0432 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0433\u0440 \u0438\u0437-\u0437\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.  <\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0443\u0447\u0438, \u0438\u043c\u0435\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u0432\u043d\u043e \u0438 \u0448\u0438\u0440\u043e\u043a\u043e \u043e\u0431\u043a\u0430\u0442\u0430\u043d\u044b \u0432 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0438\u0437 \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 \u0445\u0432\u0430\u0442\u0438\u0442 \u0441\u043c\u0435\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0442\u0430\u0449\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442, \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0434\u0432\u0438\u0436\u043a\u0438 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443<code>std::string_view<\/code> \u0438 <code>std::pmr::string<\/code> \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/841214\/\"> https:\/\/habr.com\/ru\/articles\/841214\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0438 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0431\u044b\u043b\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e\u0435, \u043a\u0440\u043e\u043c\u0435, \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e, \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0433\u0434\u0435 \u0431\u044b\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0447\u0435\u0433\u043e-\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442 \u043d\u0430\u0431\u043e\u0440\u0430 ASCII \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041d\u043e, \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0434\u0430\u0436\u0435 \u044d\u0442\u0438 \u0440\u0435\u0441\u0443\u0440\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u043c\u0443\u0434\u0440\u044f\u043b\u0438\u0441\u044c \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 200 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0431\u043e\u0440\u0430 ASCII, \u0430 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0447\u0442\u043e \u0438\u0433\u0440\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438, \u0442\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u0435\u0441\u0442\u044c \u0442\u0443\u0442 \u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430, \u0441\u0442\u0430\u0440\u0430\u043d\u0438\u044f\u043c\u0438 Sony \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u043b\u0435\u0432\u044b\u0445, \u0435\u0449\u0435 \u0434\u043e 20 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438\u0433\u0440 \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b\u0439 ASCII \u043d\u0430 PS1 \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Unicode (ISO 10646), \u0441 \u0432\u044b\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0434\u043a \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043b\u043e\u0439\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 UTF-16 \u0438 UTF-32, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 PS3 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 UTF-8.  <\/p>\n<pre><code class=\"cpp\">int main() {   char     c1{ 'a' };       \/\/ 'narrow' char   char8_t  c2{ u8'a' };     \/\/ UTF-8  - (PS3 and later)   char16_t c3{ u'\u8c93' };     \/\/ UTF-16 - (PS2)   char32_t c4{ U'????' };   \/\/ UTF-32 - (PS2 limited)   wchar_t  c5{ L'\u03b2' };      \/\/ wide char - wchar_t }<\/code><\/pre>\n<h3>C-Style \u0441\u0442\u0440\u043e\u043a\u0438 (NTBS)<\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u041b\u044e\u0431\u0430\u044f \u0431\u0430\u0439\u0442\u043e\u0432\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c (NTBS), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0430\u0439\u0442\u043e\u0432 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b (\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u043c &#8216;\\0&#8217;).<\/p>\n<p><strong>\u0414\u043b\u0438\u043d\u0430 NTBS<\/strong> \u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0435\u043c\u0443 \u043d\u0443\u043b\u0435\u0432\u043e\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443. \u041f\u0443\u0441\u0442\u0430\u044f NTBS \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u043d\u043e\u043b\u044c.<\/p>\n<p><strong>\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b<\/strong>  \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0434\u0432\u043e\u0439\u043d\u044b\u043c\u0438 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 (&#187; &#171;).<\/p>\n<pre><code class=\"cpp\">int main(void) {   char string_literal[] = \"Hello World\";         std::cout &lt;&lt; sizeof(string_literal) &lt;&lt; '\\n';  \/\/ 12   std::cout &lt;&lt; strlen(string_literal) &lt;&lt; '\\n';  \/\/ 11 }<\/code><\/pre>\n<p>\u0412 C\/C++ \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (&#8216;) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u041e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 (&#8216; &#8216;) \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a, \u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0435 SDK \u043e\u0442 Sony \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0438 \u0441\u0442\u0440\u043e\u043a\u0438, \u044d\u0442\u0443 \u0436\u0435 \u0440\u043e\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u0441\u0438\u043c\u0432\u043e\u043b &#8216;`&#8217; (&#171;\u0433\u0440\u0430\u0432\u0438\u0441&#187; \u0438\u043b\u0438 &#171;backtick&#187;), \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u043a\u0430\u0432\u044b\u0447\u043a\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u043b \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u043b\u0438\u0436\u0435 \u043a \u043d\u0430\u0447\u0430\u043b\u0443  &#171;.rodata&#187;, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 exe, \u0447\u0442\u043e \u0438\u043c\u0435\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.    <\/p>\n<pre><code class=\"cpp\">char string_literal[] = `Hello World`;  \/\/ \u0442\u043e\u0436\u0435 \u0441\u0442\u0440\u043e\u043a\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 rodata char another_string_literal[] = 'Hello World'; \/\/ \u0442\u0430\u043a \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e<\/code><\/pre>\n<h3>C-\u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/h3>\n<p>\u0412 \u0447\u0435\u043c \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u043e\u043a?  (<a href=\"https:\/\/godbolt.org\/z\/xT3b7TdPf\" rel=\"noopener noreferrer nofollow\">godbolt<\/a>)<\/p>\n<pre><code class=\"cpp\"> int main() {    char message[] = \"this is a string\";    printf(\"%u\\n\", sizeof(message));     const char *msg_ptr = \"this is a string\";    printf(\"%u\", sizeof(msg_ptr)); }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"assembly\">main:         push    rbp         mov     rbp, rsp         sub     rsp, 48         mov     rax, qword ptr [rip + .L__const.main.message]         mov     qword ptr [rbp - 32], rax         mov     rax, qword ptr [rip + .L__const.main.message+8]         mov     qword ptr [rbp - 24], rax         mov     al, byte ptr [rip + .L__const.main.message+16]         mov     byte ptr [rbp - 16], al         lea     rdi, [rip + .L.str]         mov     esi, 17         mov     al, 0         call    printf@PLT         lea     rax, [rip + .L.str.1]         mov     qword ptr [rbp - 40], rax         lea     rdi, [rip + .L.str.2]         mov     esi, 8         mov     al, 0         call    printf@PLT         xor     eax, eax         add     rsp, 48         pop     rbp         ret  .L__const.main.message:         .asciz  \"this is a string\"  .L.str:         .asciz  \"%u\\n\"  .L.str.1:         .asciz  \"this is a string\"  .L.str.2:         .asciz  \"%u\"<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 17, \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b). \u0412\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f.  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b, \u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f <code>message<\/code> \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. <\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f <code>msg_ptr<\/code> \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 <code>.rodata<\/code>, \u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043d\u043e \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043e\u0442 \u0442\u0435\u0445 \u0441\u0442\u0440\u043e\u043a \u0441 \u0433\u0440\u0430\u0432\u0438\u0441\u043e\u043c \u0431\u044b\u043b\u043e, \u0447\u0442\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 &#171;\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u043b\u0438\u0441\u044c&#187; \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0442\u043e\u0440\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u044b\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u044d\u0442\u0443 \u0441\u0435\u043a\u0446\u0438\u044e, \u0447\u0435\u043c \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u0431\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0441\u0435\u0439\u0432\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043e\u0431\u043b\u0435\u0441\u0442\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Nintendo \u0440\u0435\u0448\u0438\u043b\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u043b\u0430\u0432\u043d\u043e\u0435 \u0434\u0435\u043b\u043e Sony, \u0432 \u043f\u043b\u0430\u043d\u0435 \u043f\u043e\u0434\u043a\u0438\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0435\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u0434\u043a (\u0441 2018 \u0433\u043e\u0434\u0430) \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0430 \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u0431\u0430\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<h3>C String Standard Library<\/h3>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e SDK \u0432\u0435\u043d\u0434\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 <code>&lt;string.h&gt;<\/code>, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 strcpy\/strlen. \u041d\u0443 \u0432\u0441\u0435 \u043a\u0440\u043e\u043c\u0435 Sony. \u0414\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 clang, \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0435 SDK \u043d\u0435 \u0431\u044b\u043b\u043e. \u041d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043b\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438 \u0443\u0436\u0435 \u0438\u043c\u0435\u043b\u0438 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u041c\u0430\u0439\u043a\u0440\u043e\u0441\u043e\u0444\u0442, \u043a\u0441\u0442\u0430\u0442\u0438 \u0442\u0430\u043a\u0438\u043c \u043d\u0430\u043f\u043b\u0435\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u043b \u0438 \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0430\u043c\u044b\u0445 \u043f\u0435\u0440\u0432\u044b\u0445 SDK \u0434\u043b\u044f xbox.<\/p>\n<pre><code class=\"cpp\">copying strings         : strcpy, strncpy, strdup concatenating strings   : strcat, strncat, strappend comparing strings       : strcmp, strncmp parsing strings         : strcspn, strstr, strchr, strchrrev, strupper... tokenize                : strtok, strsplit length                  : strlen, strempty<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c, \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0442\u043e\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 NTBS. \u0423 Sony \u0431\u044b\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438\u0441\u044c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0430\u0439\u0442, \u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u0438 \u0431\u043b\u043e\u043a\u0438 \u0431\u044b\u043b\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0431\u043b\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 4 \u0438 5 \u0432\u0435\u0440\u0441\u0438\u0439 \u0421\u0414\u041a \u043e\u043d\u0438 \u043d\u0435 \u043f\u043e\u0448\u043b\u0438, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u044b. \u041f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0442\u0430\u043a\u0438\u0445 \u0438\u0437\u044b\u0441\u043a\u043e\u0432 \u0431\u044b\u043b\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0435 \u0434\u0440\u0443\u0433 \u0437\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0432\u0437\u043b\u043e\u043c\u044b \u0432 <strong>PS3 Fat<\/strong> \u0438 <strong>PS3 Slim<\/strong>.<\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u0441\u0430\u043c\u0430\u044f \u0448\u0438\u0440\u043e\u043a\u0430\u044f, \u043b\u044e\u0431\u043e\u0439 \u0441\u043e\u0444\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438. \u0412 \u0438\u0433\u0440\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0432 \u0447\u0438\u0441\u0442\u043e\u043c \u0432\u0438\u0434\u0435 \u043c\u0430\u043b\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d \u0432 \u0441\u0438\u043b\u0443 \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u0431\u0443\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430, \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043c\u0435\u0436\u0434\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u043c\u0438.<\/p>\n<\/blockquote>\n<h4>C++ \u0441\u0442\u0440\u043e\u043a\u0438<\/h4>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 C++ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>&lt;string&gt;<\/code>. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0442\u0438\u043f <code>std::string<\/code> \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043c\u0438 \u2014\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432, \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e, \u043f\u043e\u0438\u0441\u043a \u0438 \u0442. \u0434., \u0447\u0442\u043e \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u0441\u0442\u0440\u043e\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c C-c\u0442\u0440\u043e\u043a, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u041e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0435\u043c\u0443, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<pre><code class=\"cpp\">const std::string this_string { \"This is\" }; \/\/ initialise  int main() {   std::string name = \" string\";     std::string concat_str =  this_string + name; \/\/ concatenation    std::cout &lt;&lt; concat_str;    if (!this_string.empty()) {     std::cout &lt;&lt; '\\n' &lt;&lt; this_string.length() &lt;&lt; '\\n';     std::cout &lt;&lt; this_string[0] &lt;&lt; ' ' &lt;&lt; this_string.front() &lt;&lt; '\\n';     std::cout &lt;&lt; this_string[this_string.length()-1] &lt;&lt; ' ' &lt;&lt; concat_str.back() &lt;&lt; '\\n';   } }  &lt;&lt;&lt;&lt;&lt;&lt; This is string 7 T T s g<\/code><\/pre>\n<p><code>std::string<\/code> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0442\u0430\u043c, \u0433\u0434\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f <code>const char*<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u0435 data \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u043b\u0435\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f. \u0410 \u043c\u043d\u043e\u0433\u0438\u0435 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435) \u0441\u0434\u043a \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u0442\u0443\u043b\u0437\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0421-API, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>std::string<\/code> \u0432 <code>const char*<\/code>. C-API \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0432\u044b\u0431\u0440\u0430\u043d \u043d\u0435 \u043e\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0436\u0438\u0437\u043d\u0438, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ABI \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u043d\u0434\u043e\u0440\u0430\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438, \u043d\u043e \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0430\u0436\u0435 \u043c\u0438\u043d\u043e\u0440\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u043a\u0430\u043a \u044d\u0442\u043e \u043b\u044e\u0431\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c Nintendo, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u043e\u043c\u0430\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 SDK. \u0418 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u043d\u0434\u043b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u044b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e firmware, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435.<\/p>\n<p>\u0423 <code>std::string<\/code> \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>.c_str()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0441\u0442\u0438\u043b\u0435 C (<code>const char*<\/code>). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <code>std::string<\/code>, \u043a\u0430\u043a \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 <code>.data()<\/code> \u0438\u043b\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>std::data()<\/code>.  <\/p>\n<blockquote>\n<p>\u041e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<br \/>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e, \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u044f\u0441\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437-\u0437\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<\/blockquote>\n<h3>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h3>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>std::string<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 <code>::new<\/code> \u0438 <code>::delete<\/code> \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043a\u0443\u0447\u0435, \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u043d\u0443\u043b\u0435\u043c (NTBS).  <\/p>\n<pre><code class=\"cpp\">int main() {     const char* this_is_ro_string = \"literal string\";    \/\/ stored in .rodata     char this_is_stack_string[] = \"literal string\";      \/\/ stored on stack     std::string this_is_heap_string = \"Literal String\";  \/\/ stored in .heap  }<\/code><\/pre>\n<p><code>std::strings<\/code>\u00a0\u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">class string {   data\u00a0-&gt; \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437\u00a0.data()   length\u00a0-&gt; \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u0435\u0442\u0443\/\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445             \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437\u00a0.length()\u00a0or\u00a0.size()   capacity\u00a0-&gt; \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 ( &gt;= length); \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437\u00a0.capacity() }<\/code><\/pre>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 SDK \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0431\u0443\u0444\u0435\u0440 \u0438\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435, \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0443\u043b\u043e\u043c \u043f\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0432 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0435\u043d\u0434\u043e\u0440\u0430. \u042d\u0442\u043e \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0434\u0432\u0438\u0436\u043a\u043e\u0432, \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u0440\u043e\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<h3>Short String Optimisation (SSO)<\/h3>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Clang) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e &#8212; \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a (Short-String Optimisation, SSO). \u041a\u043b\u0430\u0441\u0441 \u0441\u0442\u0440\u043e\u043a\u0438<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-431360","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/431360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=431360"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/431360\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=431360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=431360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=431360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}