<br><br><div class="gmail_quote">On Wed, May 25, 2011 at 8:07 PM, Benjamin Peterson <span dir="ltr">&lt;<a href="mailto:benjamin@python.org">benjamin@python.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/5/25 Alex Gaynor &lt;<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>&gt;:<br>
<div class="im">&gt; I have a question about SmallTuples.  Why do we have multiple classes,<br>
&gt; rather than doing the &quot;hack&quot; of mallocing a single block of memory for the<br>
&gt; entirety of the object, since it is immutable and we can know the needed<br>
&gt; space up front, CPython uses this &quot;hack&quot; for strs for example.<br>
<br>
</div>What do you mean by that? Isn&#39;t having multiple classes the RPython<br>
equivalent of this hack?<br>
<br>
<br>
<br>
--<br>
Regards,<br>
<font color="#888888">Benjamin<br>
</font></blockquote></div><br>Well, IMO the issue is you can end up with a ton of guard_class that are more precise than you need, plus you have to manually specialize for each length, whereas with the other approach you can just automatically apply it to all tuples.<br>
<br>Alex<br clear="all"><br>-- <br>&quot;I disapprove of what you say, but I will defend to the death your right to say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>&quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
<br>