<br><br><div class="gmail_quote">On Mon, May 9, 2011 at 2:16 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Just a follow-up to recent thread.<br>
<br>
Suppose that we have new object format which supports multiple memory regions.<br>
I.e.<br>
eden space<br>
old space<br>
pinned space<br>
...<br>
and<br>
immutable space<br>
<br>
so, instead of adding a flag per object whether its immutable or not,<br>
and then check this flag every time there is a write attempt,<br>
we could simply let hardware handle this.<br>
And immutable space is a memory region with read-only access, So once<br>
placed &amp; sealed , any attempt to write, we lead to a hardware<br>
exception,<br>
which can be nicely handled :)<br>
<br>
So, we will have a single entry point for all write access , and don&#39;t<br>
need to spread an immutability logic all over the places.<br>
And of course hardware &#39;check if memory is writeable&#39; is much faster<br>
than software one.<br>
<br>
What you think?<br>
<font color="#888888"><br></font></blockquote><div><br>Javier Pimas proposed me last month a very similar idea but for proxies instead of immutable objects ;) <br></div></div><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
<br>