{"id":444,"date":"2010-09-30T16:18:05","date_gmt":"2010-09-30T12:48:05","guid":{"rendered":"http:\/\/www.blog.seganx.com\/?p=444"},"modified":"2024-03-18T16:08:28","modified_gmt":"2024-03-18T16:08:28","slug":"address-spaces-problem","status":"publish","type":"post","link":"https:\/\/sajad-b.com\/?p=444","title":{"rendered":"Address Spaces Problem"},"content":{"rendered":"<p>As you know the Windows operating system defines an address space area for each process to prevent data hacks and data corruption that may occur by other processes. This approach has some advantages but with a few problems.<br \/>\nA simple (but popular) problem appears when memory blocks are allocated in one process (a DLL for instance) and transported to the other (an application for instance) and then should be reallocated or free in another process! The exception will rise at this point because different memory managers in different address spaces want to operate on non-shared blocks of memory.<br \/>\nYou may never see this problem because people usually use default shared libraries, but for me, this is another test and practice \ud83d\ude00<br \/>\nAt this time to manage memory block transitions between engine and application address spaces, I added <strong>sxAlloc<\/strong> object to the <strong>sxLib<\/strong> that can redirect memory allocators in <strong>sxMemory<\/strong> to the engine from other address spaces. So all <strong>default<\/strong> data containers represented in the last post will use engine address space and become safe to transport data between engine and other processes. however, I can still redefine any container with a different allocator to use anywhere I like.<br \/>\nhere is the concept in the image:<\/p>\n<div id=\"attachment_446\" style=\"width: 459px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/sajad-b.com\/wp-content\/uploads\/2010\/09\/Data-transition-between-address-spaces.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-446\" class=\"size-full wp-image-446\" title=\"Data transition between address spaces\" src=\"https:\/\/i0.wp.com\/sajad-b.com\/wp-content\/uploads\/2010\/09\/Data-transition-between-address-spaces.jpg?resize=449%2C203&#038;ssl=1\" alt=\"\" width=\"449\" height=\"203\" srcset=\"https:\/\/i0.wp.com\/sajad-b.com\/wp-content\/uploads\/2010\/09\/Data-transition-between-address-spaces.jpg?w=449&amp;ssl=1 449w, https:\/\/i0.wp.com\/sajad-b.com\/wp-content\/uploads\/2010\/09\/Data-transition-between-address-spaces.jpg?resize=300%2C136&amp;ssl=1 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><p id=\"caption-attachment-446\" class=\"wp-caption-text\">Data transition between Engine and Application address spaces<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>As you know the Windows operating system defines an address space area for each process to prevent data hacks and data corruption that may occur by other processes. This approach has some advantages but with a few problems. A simple (but popular) problem appears when memory blocks are allocated in one process (a DLL for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[10,20,45],"class_list":["post-444","post","type-post","status-publish","format-standard","hentry","category-engine","tag-address-space","tag-containers","tag-shared-memory"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/posts\/444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sajad-b.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444"}],"version-history":[{"count":1,"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/posts\/444\/revisions"}],"predecessor-version":[{"id":857,"href":"https:\/\/sajad-b.com\/index.php?rest_route=\/wp\/v2\/posts\/444\/revisions\/857"}],"wp:attachment":[{"href":"https:\/\/sajad-b.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sajad-b.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sajad-b.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}