{"id":304944,"date":"2020-06-06T21:00:43","date_gmt":"2020-06-06T21:00:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304944"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304944","title":{"rendered":"\u0410\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/505632\/\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0442\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0445 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043e \u043d\u0438\u0445. \u0421\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0441\u0435\u0442\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u043b\u044b\u0448\u0438\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u00ab\u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u00bb, \u00ab\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438\u00bb \u0438 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u043e, \u0442\u043e \u0442\u043e\u0433\u0434\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/habr.com\/ru\/post\/274827\/\">\u0434\u0430\u043d\u043d\u044b\u043c<\/a> \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438 \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0441\u0430\u043c\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u0421++.<\/p>\n<hr>\n<p>  <\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u044b<\/h2>\n<p>  \u041a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043d\u0430\u0434 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c (\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u044f\u0432\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443):<\/p>\n<ul>\n<li><i>create<\/i> \u2013 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u0435\u043c\u0443 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438;<\/li>\n<li><i>allocate<\/i> \u2013 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0431\u043b\u043e\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440;<\/li>\n<li><i>deallocate<\/i> \u2013 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a;<\/li>\n<li><i>free<\/i> \u2013 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 (\u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443, \u043d\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f);<\/li>\n<li><i>destroy<\/i> \u2013 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>Linear Allocator<\/h2>\n<p>  Linear Allocator, \u043e\u043d \u0436\u0435 \u00ab\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439\u00bb \u2014 \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0438\u0434 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432. \u0418\u0434\u0435\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e. \u0412 \u044d\u0442\u043e\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u0432\u0435\u0434\u0435\u043d\u0430 \u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c), \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u2014 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0432\u043d\u044b\u0439 14 \u0431\u0430\u0439\u0442\u0430\u043c \u0438 \u043e\u0442\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0438\u0436\u0435, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (<i>start<\/i>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u043c \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u043b\u0438\u0431\u043e \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0431\u0449\u0435\u043c (<i>end<\/i>) \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u043c (<i>used<\/i>) \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vg\/aa\/wg\/vgaawgiqzerseegtgqvk0qbjhus.png\"><\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0432 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 4 \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<\/p>\n<ul>\n<li>\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f;<\/li>\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c used, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0431\u043b\u043e\u043a \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430;<\/li>\n<li>\u0441\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c used \u043d\u0430 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443 \u0440\u0430\u0432\u043d\u0443\u044e \u043e\u0431\u044a\u0435\u043c\u0443 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442.\u0435. \u043d\u0430 4 \u0431\u0430\u0439\u0442\u0430.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wp\/3q\/_r\/wp3q_r2dp-ywsaou93vzk8zhqkk.png\"><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 8 \u0431\u0430\u0439\u0442 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/di\/g4\/ih\/dig4ihecjl8qfasqqonhdqtt2lm.png\"><\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e 1 \u0431\u0430\u0439\u0442\u0430, \u0438 \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u0440\u0430\u0442\u043d\u044b\u0435 2, 4, \u2026), \u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vz\/x_\/cc\/vzx_cc45oildurtaxdyi7n9fi7i.png\"><\/p>\n<p>  \u041d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u043b\u043e\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043a\u0440\u0430\u0442\u043d\u044b\u0445 2), \u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u043d\u043e \u043d\u0435 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0441\u0430\u043c\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0432\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u0430\u0439\u0442\u0430, \u043c\u044b \u0435\u0449\u0435 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0441\u043c\u044b\u0441\u043b\u043e\u0432\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041a\u0430\u043a \u0440\u0430\u0437-\u0442\u0430\u043a\u0438 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jx\/xg\/pz\/jxxgpzvrvs9nhyodrphmi1xg1sy.png\"><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e\u0431 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u041a\u0430\u043a \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434 \u0430\u043b\u043b\u043e\u043a\u043e\u0442\u043e\u0440\u043e\u0432 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043d\u043a\u0443\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044e \u0441 <i>malloc\/free<\/i>, \u0438\u043c\u0435\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u0441\u043a\u0430\u0436\u0435\u043c, \u043d\u0430 <b>0xFFAA00<\/b>, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u043e \u0432\u043e\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043d\u0430\u043c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mj\/es\/_0\/mjes_04nsdmq3bfiolwehoxwdfk.png\"><\/p>\n<p>  \u0412\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u044e \u0437\u0430\u043d\u044f\u0442\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c, \u043a\u0430\u043a \u0441 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0443\u0441\u0442\u044b\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vg\/aa\/wg\/vgaawgiqzerseegtgqvk0qbjhus.png\"><\/p>\n<hr>\n<p>  <\/p>\n<h2>Pool Allocator<\/h2>\n<p>  \u0418\u0434\u0435\u044f \u0431\u043b\u043e\u0447\u043d\u043e\u0433\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 <b>\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430<\/b>. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0430 \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u043e, \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u044d\u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0430. <\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435, \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0440\u0430\u0432\u043d\u044b\u0439 12 \u0431\u0430\u0439\u0442 \u0438 \u043e\u0442\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0438\u0436\u0435, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e (<i>start<\/i>) \u0438 \u043a\u043e\u043d\u0435\u0446 (<i>end<\/i>) \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043f\u0438\u0441\u043e\u043a (<i>freeblocks<\/i>) \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u043b\u043e\u043a \u0437\u0430\u043d\u044f\u0442 \u0438\u043b\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u0435\u043d, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u0431\u0443\u043b\u0435\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043d\u043e \u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u0435 \u043e\u0434\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e (\u043a\u0441\u0442\u0430\u0442\u0438, \u0441\u0430\u043c\u0438 \u0437\u0432\u0435\u043d\u044c\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0431\u0440\u0430\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/co\/6s\/5o\/co6s5o7c7ufuvofrrb1oqwke8vy.png\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0437\u0432\u0435\u043d\u044c\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0442\u0430\u043c \u043d\u0435\u0442, \u0442\u043e \u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0432 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 \u0443\u0436\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0437\u0432\u0435\u043d\u043e, \u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0435 \u0438\u043b\u0438 \u0445\u0432\u043e\u0441\u0442\u043e\u0432\u043e\u0435 (\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442\u0434\u0430\u044e\u0442\u0441\u044f \u0445\u0432\u043e\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u0432\u0435\u043d\u044c\u044f) \u0437\u0432\u0435\u043d\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uc\/j_\/44\/ucj_44gjfi99_jf4whquo4sra78.png\"><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ri\/qc\/zy\/riqczyaeceqtxdshywd0py4r0nw.png\"><\/p>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0431\u043b\u043e\u043a\u0430, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e\u0442 \u0430\u0434\u0440\u0435\u0441 \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u043d\u0446\u043e\u0432 \u043e\u0434\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0447\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0431\u043b\u043e\u043a\u0430 \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0439\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0430\u0434\u0440\u0435\u0441, \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <b>0xEFAB12<\/b>, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u043c\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u0442\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0442\u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 (\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a undefined behavior \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0437\u0435\u0442, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043a \u043a\u0440\u0430\u0445\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b). \u0414\u043b\u044f \u0438\u0437\u0431\u0435\u0433\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043a\u0430\u043a \u0440\u0430\u0437-\u0442\u0430\u043a\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <i>begin<\/i> \u0438 <i>end<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435 \u043e\u0448\u0438\u0431\u0441\u044f \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gd\/0n\/ed\/gd0nedbx2nlhsrxggnymb42keey.png\"><\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043b\u044e\u0431\u043e\u0439 \u0430\u0434\u0440\u0435\u0441, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441\u0443 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u0438\u0437 \u0431\u043b\u043e\u043a\u043e\u0432, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0431\u043b\u043e\u043a\u0430 \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c <b>0xFFAA07<\/b>. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a undefined behavior. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0432\u0441\u0435 \u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c. \u0414\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438 \u0437\u0430\u043d\u044f\u0442\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430 \u043a\u0440\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 (\u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438 \u0438 \u043e\u0442 \u043a\u043e\u043d\u043a\u0435\u0440\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3u\/mn\/hw\/3umnhwagefbl_eysi3zl6yhu9be.png\"><\/p>\n<hr>\n<p>  <\/p>\n<h2>Stack Allocator<\/h2>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044d\u0442\u043e \u0443\u043c\u043d\u0430\u044f \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u043a\u0430\u043a \u0441\u0442\u0435\u043a\u043e\u043c. \u0412\u0441\u0435 \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u00abheader\u00bb \u0431\u043b\u043e\u043a\u043e\u043c (\u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c\u0441\u044f, \u043a\u0430\u043a <b>\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/b>) \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u043c \u0435\u0433\u043e \u0432\u043f\u0435\u0440\u0435\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0437\u0430\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e deallocate, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0432\u0441\u0435 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0431\u043b\u043e\u043a\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 14 \u0431\u0430\u0439\u0442. \u041a\u0430\u043a \u0438 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0430\u043c\u044f\u0442\u0438 (<i>start<\/i>) \u0438 \u043a\u043e\u043d\u0435\u0446 (<i>end<\/i>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043a\u043e\u043d\u0435\u0446 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 (<i>used<\/i>).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ba\/sb\/qv\/basbqv8yj_v1sijo_td54pa472k.png\"><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u0435\u0435 \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u043c\u044b \u0435\u0449\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u043d\u0438\u043c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u0431\u0430\u0439\u0442 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 2 \u0431\u0430\u0439\u0442\u0430). \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 2 \u0431\u0430\u0439\u0442, \u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435. \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u043d \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043d\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0430 \u043d\u0430 \u0431\u043b\u043e\u043a, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0431\u043b\u043e\u043a \u0441 \u0430\u0434\u0440\u0435\u0441\u043e\u043c <b>0xFFAA02<\/b>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bg\/qb\/q2\/bgqbq2fei1egpmowdnmz9vciplo.png\"><\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c 6 \u0431\u0430\u0439\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/up\/pf\/x_\/uppfx_dpultvroggfr2rvy7lxhc.png\"><\/p>\n<p>  \u0410 \u0432\u043e\u0442 \u0441 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 (\u043a\u0430\u043a \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 <b>LIFO<\/b>). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0438\u0442 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0443\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c <i>used<\/i> \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0431\u043b\u043e\u043a\u0430, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430. \u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441 \u0431\u043b\u043e\u0447\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u00ab\u0440\u0430\u043d\u0434\u043e\u043c\u043d\u044b\u0445\u00bb \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a undefined behavior. \u0414\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u043d\u0435\u0442 \u2013 \u0434\u0435\u043b\u043e \u043a\u0430\u0436\u0434\u043e\u0433\u043e. \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/as\/fh\/s4\/asfhs4qflx43fwr9jizq-zmsatq.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u0445, \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0435. <\/p>\n<hr>\n<p>  <\/p>\n<h2>\u00ab\u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u00bb<\/h2>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 STL. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0445\u043e\u0436 \u0441 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c. \u0425\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0442\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 malloc, \u043c\u043d\u043e\u044e \u0431\u044b\u043b\u0438 \u0432\u0437\u044f\u0442\u044b \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412\u0441\u0435 \u0435\u0433\u043e \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0438 \u043d\u044e\u0430\u043d\u0441\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0435 \u0431\u044b\u043b\u0438 \u0443\u0447\u0442\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u2026<\/p>\n<p>  \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043b\u0435\u0436\u0438\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u00abchunks\u00bb (\u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u043e, \u043a\u0430\u043a <b>\u0443\u0447\u0430\u0441\u0442\u043e\u043a<\/b>, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u043d \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u0435\u043d \u0447\u0435\u0442\u044b\u0440\u0435\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u043b\u043b\u043e\u043a\u0442\u043e\u0440\u0430 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440, \u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u0447\u0435\u0442\u044b\u0440\u0435\u043c), \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043e\u043a c \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 16 \u0431\u0430\u0439\u0442. \u0412\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e (<i>start<\/i>) \u0438 \u043a\u043e\u043d\u0435\u0446 (<i>end<\/i>) \u043f\u0430\u043c\u044f\u0442\u0438, \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 (<i>maxblock<\/i>) \u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (<i>freeblocks<\/i>), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432. \u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 4 \u0431\u0430\u0439\u0442\u0430, \u043d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0432\u0430\u043c \u0446\u0435\u043b\u0435\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e \u0438\u043b\u0438 \u0434\u0432\u0443\u0445\u0431\u0430\u0439\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0432 \u0440\u0430\u0437\u043c\u0435\u0440\u0435 1 \u0438\u043b\u0438 2 \u0431\u0430\u0439\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nr\/xq\/3f\/nrxq3fcbnoooxnu0hehls2dghim.png\"><\/p>\n<p>  \u041f\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437 \u0443\u0447\u0430\u0441\u0442\u043a\u0430, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u044d\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0441 <i>maxblock<\/i> \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0438, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043b\u043e\u043a, \u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f). \u0415\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0434\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u043a\u0430\u043a \u0438 \u0432 \u0441\u0442\u0435\u043a\u043e\u0432\u043e\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438 \u0443\u0436\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u0437 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430, \u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5m\/lm\/yw\/5mlmywi79wh3uutr-ug7ko7s9em.png\"><\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u0445 \u0432\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3m\/2m\/i9\/3m2mi9xd9qmnf6ngnqjf8wfnzd0.png\"><\/p>\n<p>  \u041d\u043e \u0432\u043e\u0442 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u0432 \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c, \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440 \u0431\u0435\u0440\u0435\u0442 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0442\u043e\u0433\u043e \u0436\u0435 \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430). \u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u043b \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0441 \u0432\u044b\u0447\u0435\u0442\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fy\/fz\/6g\/fyfz6gthdrfysccjef_xcphihb0.png\"><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0432 \u043d\u043e\u0432\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044e, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/eu\/gc\/aleugc_fka3uvpmju9gw66dpn1w.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u0435\u043d \u0447\u0435\u0442\u044b\u0440\u0435\u043c. \u041e\u0442\u0432\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2013 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435). \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u0443 \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c, \u043b\u0438\u0431\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0438\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0438\u043d\u0430\u0447\u0435 \u044d\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u0430 \u0438 \u0441\u0430\u043c\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rq\/rp\/mv\/rqrpmvvpbx1thpxjfbqcictzq1o.png\"><\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435, \u0447\u0435\u043c \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u043e\u043a (\u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432, \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432, \u0442\u043e \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0438\u043d\u0434\u0435\u043a\u0441 \u0443\u0447\u0430\u0441\u0442\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c). \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430 \u0441\u043e \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u043c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c <i>maxblock<\/i>, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c <i>maxblock<\/i>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fw\/sl\/yl\/fwslyluxwv00a8mwazxe2iakd00.png\"><\/p>\n<p>  \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0432 \u0442\u043e\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c. \u0414\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435, \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c 6 \u0431\u0430\u0439\u0442, \u043f\u0443\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u043e \u0437\u0430\u0442\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u0442\u0432\u0435\u0440\u0434\u043e\u0435 \u0438 \u0440\u0435\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u00ab\u043d\u0435\u0442\u00bb!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tm\/ec\/dp\/tmecdpyhyynvn0ahzubdxltorvo.png\"><\/p>\n<p>  \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u0435\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f. \u0421\u0443\u0442\u044c \u0435\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043d\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b \u043b\u0438 \u0434\u0432\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0431\u043b\u043e\u043a\u0430 \u0441\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u0434\u0432\u0430 \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0431\u043b\u043e\u043a\u0430 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b, \u0442\u043e \u043e\u043d\u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u044b\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jt\/1u\/hl\/jt1uhl_a7d3xo2a3f9kedx_7waq.png\"><\/p>\n<p>  \u0415\u0449\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0442\u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u0443\u0436\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0432\u043d\u044b\u0445 1 \u0431\u0430\u0439\u0442\u0443. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c +7 \u043b\u0438\u0448\u043d\u0438\u0445 \u0431\u0430\u0439\u0442 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e \u0431\u0430\u0439\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0440\u0430\u0432\u0435\u043d 4 \u0431\u0430\u0439\u0442\u0430\u043c \u0438 \u0435\u0449\u0435 \u043f\u043b\u044e\u0441 3 \u0431\u0430\u0439\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0442\u043d\u044b \u0447\u0435\u0442\u044b\u0440\u0435\u043c. \u042d\u0442\u0438\u043c \u044f \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0441\u043b\u0435\u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r2\/ez\/v3\/r2ezv39toknyjxexeamoq05g3r8.png\"><\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u0442\u0435\u043e\u0440\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043b \u041b\u0438\u043d\u0443\u0441 \u0422\u043e\u0440\u0432\u0430\u043b\u044c\u0434\u0441: \u00ab<i>\u0411\u043e\u043b\u0442\u043e\u0432\u043d\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0442\u043e\u0438\u0442. \u041f\u043e\u043a\u0430\u0436\u0438\u0442\u0435 \u043c\u043d\u0435 \u043a\u043e\u0434<\/i>\u00bb. \u041d\u0443 \u0447\u0442\u043e \u0436, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c\u2026<\/p>\n<hr>\n<p>  <\/p>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430\u043c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u0442\u0430\u0434\u0430\u0440\u0442\u0435 \u0421++ \u0432 \u0433\u043b\u0430\u0432\u0435 &quot;<i>Allocator requirements [allocator.requirements]<\/i>&quot;. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0442\u0435\u0445 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 STL, \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">template&lt;class T&gt; class Allocator  {     typedef T value_type;     Allocator(\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430);     template &lt;class T&gt;      Allocator(const &lt;T&gt;&amp; other);     T* allocate(std::size_t count_objects);     void deallocate(T* ptr, std::size_t count_objects); };  template&lt;class T, class U&gt; bool operator==(const Allocator&lt;T&gt;&amp;, const Allocator&lt;U&gt;&amp;); template&lt;class T, class U&gt; bool operator!=(const Allocator&lt;T&gt;&amp;, const Allocator&lt;U&gt;&amp;); <\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e STL \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0443 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u0430 \u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d std::allocator_traits, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a:<\/p>\n<pre><code class=\"cpp\"> typedef T* pointer; typedef const T* const_pointer;  \u2026  <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043b\u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0438 \u0442\u0435\u043c, \u0438 \u0434\u0440\u0443\u0433\u0438\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043a\u0430\u044f \u00ab\u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0430\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0430\u043b\u043b\u043e\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439: <\/p>\n<pre><code class=\"cpp\">\/\/ Common interface for interaction with STL \/\/ containers and algorithms. You can manually change \/\/ allocation algorithm with different 'AllocationStrategy' \/\/ \/\/ In this implementation was not implented 'adress' and 'max_size' \/\/ unnecessary functions for.  template&lt;typename T, class AllocationStrategy&gt; class Allocator {     static_assert(!std::is_same_v&lt;T, void&gt;, &quot;Type of the allocator can not be void&quot;); public:     using value_type = T;      template&lt;typename U, class AllocStrategy&gt;     friend class Allocator;          template&lt;typename U&gt;     struct rebind     {         using other = Allocator&lt;U, AllocationStrategy&gt;;     }; public:     Allocator() = default;          explicit Allocator(AllocationStrategy&amp; strategy) noexcept         : m_allocation_strategy(&amp;strategy) {}          Allocator(const Allocator&amp; other) noexcept         : m_allocation_strategy(other.m_allocation_strategy) {}          template&lt;typename U&gt;     Allocator(const Allocator&lt;U, AllocationStrategy&gt;&amp; other) noexcept         : m_allocation_strategy(other.m_allocation_strategy) {}          T* allocate(std::size_t count_objects)     {         assert(m_allocation_strategy &amp;&amp; &quot;Not initialized allocation strategy&quot;);         return static_cast&lt;T*&gt;(m_allocation_strategy-&gt;allocate(count_objects * sizeof(T)));     }          void deallocate(void* memory_ptr, std::size_t count_objects)     {         assert(m_allocation_strategy &amp;&amp; &quot;Not initialized allocation strategy&quot;);         m_allocation_strategy-&gt;deallocate(memory_ptr, count_objects * sizeof(T));     }          template&lt;typename U, typename... Args&gt;     void construct(U* ptr, Args&amp;&amp;... args)     {         new (reinterpret_cast&lt;void*&gt;(ptr)) U { std::forward&lt;Args&gt;(args)... };     }          template&lt;typename U&gt;     void destroy(U* ptr)     {         ptr-&gt;~U();     } private:     AllocationStrategy* m_allocation_strategy = nullptr; };  template&lt;typename T, typename U, class AllocationStrategy&gt; bool operator==(const Allocator&lt;T, AllocationStrategy&gt;&amp; lhs, const Allocator&lt;U, AllocationStrategy&gt;&amp; rhs) {     return lhs.m_allocation_strategy == rhs.m_allocation_strategy; }  template&lt;typename T, typename U, class AllocationStrategy&gt; bool operator!=(const Allocator&lt;T, AllocationStrategy&gt;&amp; lhs, const Allocator&lt;U, AllocationStrategy&gt;&amp; rhs) {     return !(lhs == rhs); } <\/code><\/pre>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\"> template&lt;typename T&gt; using AllocatorForSmallObjects = Allocator&lt;T, StrategyForSmallObjects&gt;; template&lt;typename T&gt; using AllocatorForBigObjects = Allocator&lt;T, StrategyForBigObjects&gt;; <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0433\u0438\u0431\u043a\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a AllocationStrategy \u2014 \u0443 \u043d\u0438\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <i>allocate<\/i> \u0438 <i>deallocate<\/i>. <\/p>\n<pre><code class=\"cpp\"> \/\/ Strategy for manipulation memory chunks, like \/\/ a primitive malloc allocator. \/\/ \/\/ Warning: if you try to deallocate some random block \/\/ of the memory, most of all it will be an undefined behavior, \/\/ because current implementation doesn't check this possible situation.  template&lt;std::size_t CHUNK_SIZE = 16'384u&gt; class CustomAllocationStrategy {     static_assert(CHUNK_SIZE != 0u, &quot;Chunk size must be more, than zero&quot;);     static_assert(CHUNK_SIZE &lt;= std::numeric_limits&lt;std::uint32_t&gt;::max(),         &quot;Chunk size must be less or equal max value of the uint32_t&quot;); public:     void* allocate(std::size_t size)     {         assert(size &lt; CHUNK_SIZE &amp;&amp; &quot;Incorrect chunk size for future usage&quot;);          if (size == 0u)         {             return nullptr;         }                  for (auto&amp; chunk : m_chunks)         {             void* allocated_block = chunk.tryReserveBlock(size);             if (allocated_block) \/\/if the block was not reserved, then memory in the chunk has run out             {                 return allocated_block;             }         }          m_chunks.push_back(details::Chunk&lt;CHUNK_SIZE&gt;{});         auto&amp; chunk = m_chunks.back();         std::uint8_t* allocated_block = chunk.tryReserveBlock(size);         return allocated_block;     }      void deallocate(void* memory_ptr, std::size_t size)     {         if ( (!memory_ptr) || (size == 0u) )         {             return;         }          std::uint8_t* deallocation_ptr = static_cast&lt;std::uint8_t*&gt;(memory_ptr);         for (auto&amp; chunk : m_chunks)         {             if (chunk.isInside(deallocation_ptr))             {                 chunk.releaseBlock(deallocation_ptr);             }         }     } private:     std::deque&lt;details::Chunk&lt;CHUNK_SIZE&gt;&gt; m_chunks{ 1u }; }; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u0421\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u0443\u0447\u0438. \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0443\u0436\u0438\u0435, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u0434\u044b, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u0435\u0441\u0442\u0438 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043b\u0435\u0433 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b.<\/p>\n<pre><code class=\"cpp\"> namespace details {      std::size_t getAlignmentPadding(std::size_t not_aligned_address, std::size_t alignment)     {         if ( (alignment != 0u) &amp;&amp; (not_aligned_address % alignment != 0u) )         {             const std::size_t multiplier = (not_aligned_address \/ alignment) + 1u;             const std::size_t aligned_address = multiplier * alignment;             return aligned_address - not_aligned_address;         }          return 0u;     }      \/\/ Current chunk implementation works only with size     \/\/ aligned by 4 bytes, because HEADER_SIZE now also 4 bytes.     \/\/ You can modify it with HEADER_SIZE without problems for your purposes.      template&lt;std::size_t CHUNK_SIZE&gt;     class Chunk     {         static constexpr std::size_t HEADER_SIZE = 4u;         static_assert(CHUNK_SIZE % HEADER_SIZE == 0, &quot;CHUNK_SIZE must be multiple of the four&quot;);         static_assert(CHUNK_SIZE &gt; HEADER_SIZE, &quot;CHUNK_SIZE must be more than HEADER_SIZE&quot;);     public:         Chunk()         {             m_blocks.resize(CHUNK_SIZE);             std::uint32_t* init_header = reinterpret_cast&lt;std::uint32_t*&gt;(m_blocks.data());             *init_header = CHUNK_SIZE - HEADER_SIZE;             m_max_block = init_header;             m_free_blocks.insert(init_header);         }                  bool isInside(const std::uint8_t* address) const noexcept         {             const std::uint8_t* start_chunk_address = reinterpret_cast&lt;const std::uint8_t*&gt;(m_blocks.data());             const std::uint8_t* end_chunk_address = start_chunk_address + CHUNK_SIZE;             return (start_chunk_address &lt;= address) &amp;&amp; (address &lt;= end_chunk_address);         }                  std::uint8_t* tryReserveBlock(std::size_t allocation_size)         {             const std::size_t not_aligned_address = reinterpret_cast&lt;std::size_t&gt;(m_max_block) + allocation_size;             const std::size_t alignment_padding = getAlignmentPadding(not_aligned_address, HEADER_SIZE);             const std::uint32_t allocation_size_with_alignment = static_cast&lt;std::uint32_t&gt;(allocation_size + alignment_padding);             if ( (!m_max_block) || (allocation_size_with_alignment &gt; *m_max_block) ) \/\/ Check on enaught memory for allocation             {                 return nullptr;             }                          \/\/ Find min available by size memory block             const auto min_it = std::min_element(m_free_blocks.cbegin(), m_free_blocks.cend(), [allocation_size_with_alignment] (const std::uint32_t* lhs, const std::uint32_t* rhs)             {                 if (*rhs &lt; allocation_size_with_alignment)                 {                     return true;                 }                                  return (*lhs &lt; *rhs) &amp;&amp; (*lhs &gt;= allocation_size_with_alignment);             });                          assert(min_it != m_free_blocks.cend() &amp;&amp; &quot;Internal logic error with reserve block, something wrong in implementation...&quot;);             assert(**min_it &gt;= allocation_size_with_alignment &amp;&amp; &quot;Internal logic error with reserve block, something wrong in implementation...&quot;);                          std::uint32_t* header_address = *min_it;             std::uint32_t* new_header_address =                 reinterpret_cast&lt;std::uint32_t*&gt;(reinterpret_cast&lt;std::uint8_t*&gt;(header_address) + HEADER_SIZE + allocation_size_with_alignment);             if (m_free_blocks.find(new_header_address) == m_free_blocks.cend()) \/\/ check if there is free memory in the current block             {                 const std::uint32_t old_block_size = *header_address;                 const std::uint32_t difference = old_block_size - HEADER_SIZE;                 if (difference &gt;= allocation_size_with_alignment) \/\/ check if there is enough space for another block                 {                     const std::uint32_t new_block_size = difference - allocation_size_with_alignment;                     *new_header_address = new_block_size;                     m_free_blocks.insert(new_header_address);                 }             }                          m_free_blocks.erase(header_address);             *header_address = static_cast&lt;std::uint32_t&gt;(allocation_size);             if (header_address == m_max_block) \/\/ if the maximum block were changed, then need to find the maximum block again             {                 \/\/ Find max block by size                 const auto max_it = std::max_element(m_free_blocks.cbegin(), m_free_blocks.cend(), [] (const std::uint32_t* lhs, const std::uint32_t* rhs)                 {                     return (*lhs) &lt; (*rhs);                 });                                  \/\/ If there are no free blocks, therefore the memory in this chunk is over                 m_max_block = (max_it != m_free_blocks.cend()) ? (*max_it) : (nullptr);             }              return reinterpret_cast&lt;std::uint8_t*&gt;(header_address) + HEADER_SIZE;         }                  void releaseBlock(std::uint8_t* block_ptr)         {             std::uint8_t* header_address = block_ptr - HEADER_SIZE;             const std::uint32_t size_relized_block = *header_address;             if ( (!m_max_block) || (size_relized_block &gt; *m_max_block) ) \/\/ if the relized block is greater than the maximum, then need to replace it             {                 m_max_block = reinterpret_cast&lt;std::uint32_t*&gt;(header_address);             }                              m_free_blocks.insert(reinterpret_cast&lt;std::uint32_t*&gt;(header_address));             auto forward_it = m_free_blocks.find(reinterpret_cast&lt;std::uint32_t*&gt;(header_address));             auto backward_it = tryDefragment(forward_it, m_free_blocks.end());             tryDefragment(std::make_reverse_iterator(backward_it), m_free_blocks.rend());         }     private:         template&lt;typename DstIterator, typename SrcIterator&gt;         constexpr DstIterator getIterator(SrcIterator it) const         {             using iterator = std::set&lt;std::uint32_t*&gt;::iterator;             using reverse_iterator = std::set&lt;std::uint32_t*&gt;::reverse_iterator;             if constexpr ( (std::is_same_v&lt;SrcIterator, iterator&gt;) &amp;&amp; (std::is_same_v&lt;DstIterator, reverse_iterator&gt;) )             {                 return std::make_reverse_iterator(it);             }             else if constexpr ( (std::is_same_v&lt;SrcIterator, reverse_iterator&gt;) &amp;&amp; (std::is_same_v&lt;DstIterator, iterator&gt;) )             {                 return it.base();             }             else             {                 return it;             }         }                  template&lt;typename Iterator&gt;         Iterator tryDefragment(Iterator start_it, Iterator end_it)         {             \/\/ primitive defragmentation algorithm - connects two neighboring             \/\/ free blocks into one with linear complexity                 auto current_it = start_it++;             auto next_it = start_it;             std::uint32_t* current_header_address = *current_it;             if ( (current_it != end_it) &amp;&amp; (next_it != end_it) )             {                 std::uint32_t* next_header_address = *next_it;                 const std::uint32_t current_block_size = *current_header_address;                 const std::uint32_t* available_current_block_address =                     reinterpret_cast&lt;std::uint32_t*&gt;(reinterpret_cast&lt;std::uint8_t*&gt;(current_header_address) + HEADER_SIZE + current_block_size);                 if (available_current_block_address == next_header_address)                 {                     const std::uint32_t next_block_size = *next_header_address;                     const std::uint32_t new_current_block_size = current_block_size + HEADER_SIZE + next_block_size;                     *current_header_address = new_current_block_size;                     if (new_current_block_size &gt; *m_max_block)                     {                         m_max_block = reinterpret_cast&lt;std::uint32_t*&gt;(current_header_address);                     }                                                  auto delete_it = getIterator&lt;std::set&lt;std::uint32_t*&gt;::iterator&gt;(next_it);                     return getIterator&lt;Iterator&gt;(m_free_blocks.erase(delete_it));                 }             }                          return current_it;         }     public:         std::vector&lt;std::uint8_t*&gt; m_blocks;         std::set&lt;std::uint32_t*&gt; m_free_blocks;         std::uint32_t* m_max_block;     };  } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0440\u0430\u0441\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438: <\/p>\n<pre><code class=\"cpp\"> template&lt;typename T, std::size_t CHUNK_SIZE = 16'384u&gt; using CustomAllocator = Allocator&lt;T, CustomAllocationStrategy&lt;CHUNK_SIZE&gt;&gt;;  template&lt;typename T&gt; using CustomAllocatorWithStackChunks = Allocator&lt;T, CustomAllocationStrategy&lt;1'024u&gt;&gt;;  template&lt;typename T&gt; using CustomAllocatorWithHeapChunks = Allocator&lt;T, CustomAllocationStrategy&lt;16'384u&gt;&gt;;  template&lt;typename T&gt; using custom_vector = std::vector&lt;T, CustomAllocator&lt;T&gt;&gt;;  template&lt;typename T&gt; using custom_list = std::list&lt;T, CustomAllocator&lt;T&gt;&gt;;  template&lt;typename T&gt; using custom_set = std::set&lt;T, std::less&lt;T&gt;, CustomAllocator&lt;T&gt;&gt;;  template&lt;typename T&gt; using custom_unordered_set = std::unordered_set&lt;T, std::hash&lt;T&gt;, std::equal_to&lt;T&gt;, CustomAllocator&lt;T&gt;&gt;;  template&lt;typename K, typename V&gt; using custom_map = std::map&lt;K, V, std::less&lt;K&gt;, CustomAllocator&lt;std::pair&lt;const K, V&gt;&gt;&gt;;  template&lt;typename K, typename V&gt; using custom_unordered_map = std::unordered_map&lt;K, std::hash&lt;K&gt;, std::equal_to&lt;K&gt;, CustomAllocator&lt;std::pair&lt;const K, V&gt;&gt;&gt;;  using custom_string = std::basic_string&lt;char, std::char_traits&lt;char&gt;, CustomAllocator&lt;char&gt;&gt;; <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u044b \u0438 \u0441 \u0443\u043c\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443: <\/p>\n<pre><code class=\"cpp\"> template&lt;typename T&gt; using custom_unique_ptr = std::unique_ptr&lt;T, std::function&lt;void(T*)&gt;&gt;;  template&lt;class Allocator, typename T = typename Allocator::value_type, typename... Args&gt; custom_unique_ptr&lt;T&gt; make_custom_unique(Allocator allocator, Args&amp;&amp;... args) {     const auto custom_deleter = [allocator](T* ptr) mutable     {         allocator.destroy(ptr);         allocator.deallocate(ptr, 1u);     };              void* memory_block = allocator.allocate(1u);     if (memory_block)     {         T* object_block = static_cast&lt;T*&gt;(memory_block);         allocator.construct(object_block, std::forward&lt;Args&gt;(args)...);         return custom_unique_ptr&lt;T&gt;{ object_block, custom_deleter };     }      return nullptr; } <\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e:<\/p>\n<pre><code class=\"cpp\"> int main(int argc, char** argv) {     CustomAllocationStrategy allocation_area{};      CustomAllocator&lt;int&gt; custom_int_allocator{ allocation_area };     custom_vector&lt;int&gt; vector{ custom_int_allocator };     for (int i = 0u; i &lt; 100; ++i)     {         vector.push_back(i);         std::cout &lt;&lt; vector.at(i) &lt;&lt; &quot; &quot;;     }          vector.resize(16u);     for (int val : vector)     {         std::cout &lt;&lt; val &lt;&lt; &quot; &quot;;     }  CustomAllocator&lt;int&gt; custom_int_allocator_copy = vector.get_allocator();     custom_unique_ptr&lt;int&gt; ptr1 = make_custom_unique&lt;CustomAllocator&lt;int&gt;&gt;(custom_int_allocator_copy, 100);     custom_unique_ptr&lt;int&gt; ptr2 = make_custom_unique&lt;CustomAllocator&lt;int&gt;&gt;(custom_int_allocator_copy, 500);     custom_unique_ptr&lt;int&gt; ptr3 = make_custom_unique&lt;CustomAllocator&lt;int&gt;&gt;(custom_int_allocator_copy, 1000);     custom_unique_ptr&lt;int&gt; ptr4 = make_custom_unique&lt;CustomAllocator&lt;int&gt;&gt;(custom_int_allocator_copy, 1500);     std::cout &lt;&lt; *ptr1 &lt;&lt; &quot; &quot; &lt;&lt; *ptr2 &lt;&lt; &quot; &quot; &lt;&lt; *ptr3 &lt;&lt; &quot; &quot; &lt;&lt; *ptr4 &lt;&lt; &quot; &quot;;          CustomAllocator&lt;float&gt; custom_float_allocator { custom_int_allocator };     custom_list&lt;float&gt; list{ { 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f }, custom_float_allocator };     for (float val : list)     {         std::cout &lt;&lt; val &lt;&lt; &quot; &quot;;     }          CustomAllocator&lt;std::pair&lt;double, double&gt;&gt; custom_pair_allocator{ allocation_area };     custom_map&lt;double, double&gt; map{ { { 1.0, 100.0 }, { 2.0, 200.0 } }, custom_pair_allocator };     for (const auto&amp; it : map)     {         std::cout &lt;&lt; &quot;{&quot; &lt;&lt; it.first &lt;&lt; &quot; : &quot; &lt;&lt; it.second &lt;&lt; &quot;} &quot;;     }          CustomAllocator&lt;double&gt; custom_double_allocator{ allocation_area };     custom_set&lt;double&gt; set{ { 1000.0, 2000.0, 3000.0 }, custom_double_allocator };     for (double val : set)     {         std::cout &lt;&lt; val &lt;&lt; &quot; &quot;;     }      CustomAllocator&lt;char&gt; custom_char_allocator{ allocation_area };     custom_string string1{ &quot;First allocated string without SBO &quot;, custom_char_allocator };     custom_string string2{ &quot;Second allocated string without SBO &quot;, custom_char_allocator };     custom_string string3{ &quot;Third allocated string without SBO &quot;, custom_char_allocator };     custom_string result_string = string1 + string2 + string3;     std::cout &lt;&lt; result_string;          return EXIT_SUCCESS; } <\/code><\/pre>\n<p>  \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0437\u0430\u043e\u0441\u0442\u0440\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0439, \u043d\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0430 \u0432 \u0442\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0432 \u0432\u0430\u0448\u0438\u0445 \u0440\u0443\u043a\u0430\u0445!<\/p>\n<hr>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439. \u0422\u0430\u043a\u0436\u0435 \u0436\u0435\u043b\u0430\u044e \u0432\u0441\u0435\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432 \u0432 \u0442\u0435\u0441\u043d\u043e\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e, \u0438 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0414\u043e\u043d\u0430\u043b\u044c\u0434\u0430 \u041a\u043d\u0443\u0442\u0430: \u00ab<i>\u041f\u0440\u0435\u0436\u0434\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u043a\u043e\u0440\u0435\u043d\u044c \u0432\u0441\u0435\u0445 \u0437\u043e\u043b<\/i>\u00bb. <\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/VladimirBalun\/std_allocators\" rel=\"nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> \u0441 \u043f\u043e\u043b\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u0430.<\/p>\n<hr>\n<p>  <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/274827\/\">habr.com\/ru\/post\/274827<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mtrebi\/memory-allocators\" rel=\"nofollow\">github.com\/mtrebi\/memory-allocators<\/a><\/li>\n<\/ol>\n<\/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=\"https:\/\/habr.com\/ru\/post\/505632\/\"> https:\/\/habr.com\/ru\/post\/505632\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/505632\/\">\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043b\u043e\u0442\u043d\u043e\u0433\u043e \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0438\u0445 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u043e \u043d\u0438\u0445. \u0421\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0441\u0435\u0442\u0438, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443.   <\/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-304944","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304944","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=304944"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304944\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}