{"id":259201,"date":"2015-06-12T08:46:01","date_gmt":"2015-06-12T04:46:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=259201"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=259201","title":{"rendered":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0431\u043e\u0440\u043a\u0430 \u0432 D"},"content":{"rendered":"<p>     \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0445\u0430\u0431\u0440!<\/p>\n<p>  \u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 D \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430. \u041e\u043d \u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u0430\u043a \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0441\u0442\u0440\u043e\u043a\u0438 (\u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b), \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u0422\u0430\u043a \u0436\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0442\u0440\u043e\u0435\u043d\u043d\u043e \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 (\u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044f, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new). GC \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418 \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430. \u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f? \u0420\u0430\u0441\u043f\u043b\u0430\u0442\u043e\u0439 \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u043f\u0440\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u0438 \u043f\u0430\u0443\u0437\u044b \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (stop-the-world) \u043d\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443. \u0415\u0441\u043b\u0438 \u044d\u0442\u0438 \u043f\u0443\u043d\u043a\u0442\u044b \u0434\u043b\u044f \u0412\u0430\u0441 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h3>\u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u043f\u043b\u043e\u0445\u043e?<\/h3>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c, \u0430 \u043f\u043b\u043e\u0445\u043e \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a \u0441\u043b\u043e\u0432\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\u0413\u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0432\u043e\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Valgrind\">valgrind<\/a>, \u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 memcheck (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u043b\u0430 \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u043b\u0430 \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0435\u0451 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e (\u0441\u0442\u0440\u043e\u043a\u0430 total heap usage).<br \/>  \u041d\u043e valgrind \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GC. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u044d\u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e \u0432 runtime D (dmd only). \u0421\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0443\u0436\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">app &quot;--DRT-gcopt=profile:1 minPoolSize:16&quot; program args <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 (\u0441\u0442\u0440\u043e\u043a\u0430) \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f runtime&#8217;\u043e\u043c \u0438 \u043d\u0435 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0434\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main.<br \/>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:  <\/p>\n<ul>\n<li>disable:0|1 \u2014 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430<\/li>\n<li>profile:0|1 \u2014 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438<\/li>\n<li>initReserve:N \u2014 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0430\u043c\u044f\u0442\u044c (\u041c\u0431)<\/li>\n<li>minPoolSize:N \u2014 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0443\u043b\u0430 (\u041c\u0431)<\/li>\n<li>maxPoolSize:N \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0443\u043b\u0430 (\u041c\u0431)<\/li>\n<li>incPoolSize:N \u2014 \u0448\u0430\u0433 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0443\u043b\u0430 (\u041c\u0431)<\/li>\n<li>heapSizeFactor:N \u2014 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u0443\u0447\u0438 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u043a\u0435 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e\u0441\u043b\u0435 \u0435\u0451 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439:  <\/p>\n<pre><code>\tNumber of collections:  101 \tTotal GC prep time:  10 milliseconds \tTotal mark time:  3 milliseconds \tTotal sweep time:  3 milliseconds \tTotal page recovery time:  0 milliseconds \tMax Pause Time:  0 milliseconds \tGrand total GC time:  17 milliseconds GC summary:   67 MB,  101 GC   17 ms, Pauses   13 ms &lt;    0 ms <\/code><\/pre>\n<h3>\u0416\u0438\u0437\u043d\u044c \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u043a\u0438 (\u043f\u043e\u0447\u0442\u0438)<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 GC \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0442\u044c \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0443\u0445\u0438\u0449\u0440\u0435\u043d\u0438\u044f\u043c.<\/p>\n<h4>\u041d\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u2014 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439<\/h4>\n<p>  \u0421\u0435\u0440\u044c\u0451\u0437\u043d\u043e? \u0410 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e?<br \/>  \u0412 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0435\u043a\u0446\u0438\u044f\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"cpp\">import core.memory; ... GC.disable(); ... <\/code><\/pre>\n<p>  \u0410 \u043a\u043e\u0433\u0434\u0430 \u00ab\u0431\u0443\u0434\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0443\u0431\u043e\u0440\u043a\u0443\u00bb \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0438\u043b\u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"cpp\">... GC.enable(); GC.collect(); \/\/ enable \u043f\u0435\u0440\u0435\u0434 collect \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u043d \u0441\u0430\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f ... <\/code><\/pre>\n<p>  \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430, \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0441\u0442\u0438.<br \/>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0451\u043c\u0430 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0435\u0451 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 \u041e\u0421\u044c\u044e.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b<\/h4>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0430\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043b\u0430\u0441\u0441\u044b, \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b \u043d\u0435 \u0441\u0430\u043c\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u044b \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0438 \u0443\u0439\u0442\u0438 \u043e\u0442 GC.<br \/>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438. \u0412 D \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0437\u043e\u043d\u044b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u0431\u0435\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0438\u043a\u0443\u0434\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438:  <\/p>\n<pre><code class=\"cpp\">import std.typecons; ... auto cls = scoped!MyClass( param, of, my, _class ); ... <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442 cls \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 MyClass, \u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0437\u043e\u043d\u044b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f GC. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e scope \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0445\u043e\u0442\u044f\u0442 \u0443\u043f\u0440\u0430\u0437\u043d\u0438\u0442\u044c \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, <a href=\"http:\/\/forum.dlang.org\/thread\/juspoa$5g9$1@digitalmars.com#post-juspoa:245g9:241:40digitalmars.com\">\u0432\u043e\u0442<\/a> \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b!<\/h4>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0438\u0442\u043e\u043a \u0438, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b, \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044f \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043a\u043e\u0446\u0435\u043f\u0446\u0438\u044e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 (range). \u0422\u0430\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 std.algorithm. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435: \u0432\u0445\u043e\u0434\u043d\u044b\u0435, \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435, \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435, \u0441 \u0434\u043b\u0438\u043d\u043e\u0439 \u0438 \u0442\u0434<br \/>  \u0421\u043c\u044b\u0441\u043b \u0438\u0445 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b), \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a front, popFront \u0438 \u0442\u0434. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u0432 \u0440\u043e\u043b\u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0432 <a href=\"http:\/\/dlang.org\/phobos\/std_range_primitives.html\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435<\/a>. \u0418\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u044d\u0442\u043e \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cpp\">import std.stdio; import std.typetuple; import std.range; import std.array;  template isIRWL(R) { enum isIRWL = isInputRange!R && hasLength!R; }  template FloatHandler(R) { enum FloatHandler = is( ElementType!R == float ); }  float avg(R1,R2)( R1 a, R2 b )     if( allSatisfy!(isIRWL,R1,R2) && allSatisfy!(FloatHandler,R1,R2) ) {     auto c = chain( a, b ); \/\/ \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u043c \u0432 \u043e\u0434\u0438\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d     float res = 0.0f;     foreach( val; c ) res += val; \/\/ foreach \u043e\u0434\u043e\u0431\u0440\u044f\u0435\u0442)     return res \/ c.length; \/\/ \u043d\u0435 \u0432\u0441\u0435 InputRange \u0438\u043c\u0435\u044e\u0442 \u0434\u043b\u0438\u043d\u0443 }  void main() {     float[] a = [1,2,3];     float[] b = [4,5,6,7];     writeln( avg( a, b ) ); \/\/ 4     float[] d = chain( a, b ).array; \/\/ \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432     writeln( d ); \/\/ [1,2,3,4,5,6,7] } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f chain \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Result (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0435\u0431\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u044c 2 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0430 \u0432\u0445\u043e\u0434\u0435. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e foreach \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u044b front \u0438 popFront, \u0430 \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430, \u0437\u0430\u0442\u0435\u043c \u0443 \u0432\u0442\u043e\u0440\u043e\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u043c.<br \/>  \u0425\u043e\u0440\u043e\u0448\u0430\u044f <a href=\"http:\/\/dconf.org\/2015\/talks\/davis.pdf\">\u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u043d\u0430 \u0442\u0435\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u0432 \u0431\u044b\u043b\u0430 \u043d\u0430 DConf2015, \u0430\u0432\u0442\u043e\u0440 Jonathan M Davis.<\/p>\n<h4>\u0415\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/h4>\n<p>  \u0414\u0430 \u0442\u0430\u043a\u0438\u0445, \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e FreeList  <\/p>\n<pre><code class=\"cpp\">class Foo {     static Foo freelist; \/\/ \u0433\u043e\u043b\u043e\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430     Foo next; \/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430     static Foo allocate()     {         Foo f;         if( freelist ) \/\/ \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442         {             f = freelist; \/\/ \u0431\u0435\u0440\u0451\u043c \u0435\u0433\u043e             freelist = f.next;         }         else f = new Foo(); \/\/ \u0438\u043d\u0430\u0447\u0435 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439         return f;     }       static void deallocate(Foo f) \/\/ \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445     {         f.next = freelist;         freelist = f;     }     ... \u0442\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 ... }  ...     Foo f = Foo.allocate();     ...     Foo.deallocate(f); <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u044d\u0442\u043e \u043d\u0430\u0441 \u043d\u0435 \u043e\u0433\u043e\u0440\u0430\u0436\u0438\u0432\u0430\u0435\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c, \u0442\u043e \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a \u0441\u043b\u043e\u0432\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\u0412\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.  <\/div>\n<\/div>\n<h3>\u0416\u0438\u0437\u043d\u044c \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u043a\u0438 (\u043d\u0443 \u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c)<\/h3>\n<p>  \u042f \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430 D \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u043d\u043e \u044d\u0442\u043e, \u043e\u0442\u0447\u0430\u0441\u0442\u0438, \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u0438 \u0445\u043e\u0440\u043e\u0448\u043e. \u0420\u0443\u0447\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0447\u0440\u0435\u0432\u0430\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e, \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e \u0438 \u0442\u0434 (\u0441\u0442\u0430\u0440\u044b\u0439 \u0438 \u0437\u043b\u043e\u0439 \u0421++). \u041d\u043e \u0435\u0441\u043b\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 libc malloc \u0438 free. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e:  <\/p>\n<pre><code class=\"cpp\">import core.stdc.stdlib; ... auto arr = (cast(float*)malloc(float.sizeof*count))[0..count]; ... free( arr.ptr ); ... <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0433\u0440\u0430\u0434\u0438\u0442\u044c \u0441\u0435\u0431\u044f \u043e\u0442 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GC \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442  @nogc. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u043b\u043e\u043a\u043e\u0432 \u0441 \u0442\u0430\u043a\u0438\u043c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c.   <\/p>\n<pre><code class=\"cpp\">void foo() {} void func(int[] arr) @nogc {     auto a = new MyClass; \/\/ \u043e\u0448\u0438\u0431\u043a\u0430     arr ~= 42; \/\/ \u043e\u0448\u0438\u0431\u043a\u0430     foo(); \/\/ \u043e\u0448\u0438\u0431\u043a\u0430: \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u043a @nogc } <\/code><\/pre>\n<p>  \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437  @nogc \u043a\u043e\u0434\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u043a  @nogc, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438\u043d\u0441\u0442\u0430\u0446\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435  @nogc \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<p>  \u041f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a: <\/p>\n<pre><code class=\"bash\">dmd -vgc source.d ... <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0436\u0435\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  \u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c C-\u0448\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 malloc \u0438 free.<\/p>\n<h4>\u0418 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0431\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430<\/h4>\n<p>  \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438<\/p>\n<pre><code class=\"cpp\">import std.stdio; import core.exception; import core.stdc.stdlib : malloc, free; import core.stdc.string : memcpy; import core.memory : GC;  import std.traits;  class A {     int x;     this( int X ) { x = X; }     int foo() { return 2 * x; } }  class B : A {     int z = 2;     this( int x ) { super(x); }     override int foo() { return 3 * x * z; } }  \/\/ std.conv.emplace \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c @nogc, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d T classEmplace(T,Args...)( void[] chunk, auto ref Args args )     if( is(T == class) ) {     enum size = __traits(classInstanceSize, T); \/\/ \u0443\u0437\u043d\u0430\u0451\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430      \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u044c, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c     if( chunk.length &lt; size ) return null;     if( chunk.length % classInstanceAlignment!T != 0 ) return null;       \/\/ \u043e\u0431\u044a\u0435\u043a\u0442 TypeInfo \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 init, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u044c     \/\/ \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0442\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430, \u043c\u043e\u0433\u0443 \u043e\u0448\u0438\u0431\u0430\u0442\u044c\u0441\u044f     memcpy( chunk.ptr, typeid(T).init.ptr, size );      auto res = cast(T)chunk.ptr;      \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440     static if( is(typeof(res.__ctor(args))) )         res.__ctor(args);     else         static assert(args.length == 0 && !is(typeof(&T.__ctor)),                 &quot;Don't know how to initialize an object of type &quot;                 ~ T.stringof ~ &quot; with arguments &quot; ~ Args.stringof);      return res;  }  auto heapAlloc(T,Args...)( Args args ) {     enum size = __traits(classInstanceSize, T);     auto mem = malloc(size)[0..size];     if( !mem ) onOutOfMemoryError();     \/\/GC.addRange( mem.ptr, size ); \/\/ \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435     return classEmplace!(T)( mem, args ); }  auto heapFree(T)( T obj ) {     destroy(obj);     \/\/GC.removeRange( cast(void*)obj ); \/\/ \u0438 \u043e\u0431 \u044d\u0442\u043e\u043c \u0442\u043e\u0436\u0435     free( cast(void*)obj ); }  void main() {     auto test = heapAlloc!B( 12 );     writeln( &quot;test.foo(): &quot;, test.foo() ); \/\/ 72     heapFree(test); } <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0447\u0451\u0442 \u0437\u0430\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a GC.addRange() \u0438 GC.removeRange(). \u0415\u0441\u043b\u0438 \u0412\u044b \u0442\u0432\u0451\u0440\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u0437\u0430\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b, \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0442\u043f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GC, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 GC \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0446\u0435\u043b\u044f\u0445 \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440  @nogc, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c heapAlloc \u0432  @nogc \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441 heapFree \u0432\u0441\u0451 \u0441\u043b\u043e\u0436\u043d\u0435\u0435: destroy \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u0432 (\u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c mixin&#8217;\u043e\u043c) \u0435\u0449\u0451 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0430 (\u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u0438\u0445 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430  @nogc \u0432\u0430\u0440\u0438\u0430\u043d\u0442).<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0412 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u0442 \u00ab\u043d\u0430\u0441\u0438\u043b\u044c\u043d\u043e\u0433\u043e\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043f\u043e\u0434\u0432\u0438\u0436\u043a\u0438 \u0435\u0441\u0442\u044c.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0434\u043e\u043a\u043b\u0430\u0434\u044b <a href=\"http:\/\/dconf.org\/2015\/talks\/bright.pdf\">Walter Bright<\/a> \u0438 <a href=\"http:\/\/dconf.org\/2015\/talks\/alexandrescu.pdf\">Andrei Alexandrescu<\/a> \u0441 \u0442\u043e\u0439 \u0436\u0435 DConf2015.<\/p>\n<p>  PS. \u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u0435\u0449\u0451 \u043d\u0435\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 D?<br \/>  PPS. \u041a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u043a\u0443\u0440\u0441\u0435 \u043d\u0430\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u0438 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 \u043f\u043e D \u0432 \u0420\u0424?     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/260151\/\"> http:\/\/habrahabr.ru\/post\/260151\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0445\u0430\u0431\u0440!<\/p>\n<p>  \u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 D \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430. \u041e\u043d \u0436\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043a\u0430\u043a \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0441\u0442\u0440\u043e\u043a\u0438 (\u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b), \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u044b. \u0422\u0430\u043a \u0436\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0442\u0440\u043e\u0435\u043d\u043d\u043e \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044f\u0437\u044b\u043a\u0430 (\u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044f, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 new). GC \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418 \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043c\u0443\u0441\u043e\u0440\u0430. \u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f? \u0420\u0430\u0441\u043f\u043b\u0430\u0442\u043e\u0439 \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u043f\u0440\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u0438 \u043f\u0430\u0443\u0437\u044b \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (stop-the-world) \u043d\u0430 \u043a\u0430\u043a \u0442\u0430\u043a\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443. \u0415\u0441\u043b\u0438 \u044d\u0442\u0438 \u043f\u0443\u043d\u043a\u0442\u044b \u0434\u043b\u044f \u0412\u0430\u0441 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\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-259201","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259201","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=259201"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/259201\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}