<div dir="ltr"><div>On a related note (to my last email, "MallocAllocator returns nonnull?"), I noticed that there are lots of C-style casts in Allocator.h; is there a reason to use C-style casts here? They make my eyes burn!</div><div><br></div><div>I also wouldn't be surprised if they cause strange operator precedence issues for someone in the future.</div><div><br></div><div><br></div><div>Example #1:</div><div><br></div><div><pre style="font-family:Consolas;color:gainsboro;background:rgb(30,30,30)"><span style="color:rgb(86,156,214)">char</span> <span style="color:rgb(180,180,180)">*</span><span style="color:rgb(200,200,200)">Begin</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(86,156,214)">char</span><span style="color:rgb(180,180,180)">*)</span>alignAddr<span style="color:rgb(180,180,180)">(*</span><span style="color:rgb(200,200,200)">I</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(200,200,200)">alignOf</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">T</span><span style="color:rgb(180,180,180)">>());</span>
<span style="color:rgb(86,156,214)">char</span> <span style="color:rgb(180,180,180)">*</span><span style="color:rgb(200,200,200)">End</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">*</span><span style="color:rgb(200,200,200)">I</span> <span style="color:rgb(180,180,180)">==</span> <span style="color:rgb(218,218,218)">Allocator</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(218,218,218)">Slabs</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(200,200,200)">back</span><span style="color:rgb(180,180,180)">()</span> <span style="color:rgb(180,180,180)">?</span> <span style="color:rgb(218,218,218)">Allocator</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(218,218,218)">CurPtr</span>
                                         <span style="color:rgb(180,180,180)">:</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(86,156,214)">char</span> <span style="color:rgb(180,180,180)">*)*</span><span style="color:rgb(200,200,200)">I</span> <span style="color:rgb(180,180,180)">+</span> <span style="color:rgb(200,200,200)">AllocatedSlabSize</span><span style="color:rgb(180,180,180)">;</span>
</pre></div><div><br></div><div>Example #2:</div><div><pre style="font-family:Consolas;color:gainsboro;background:rgb(30,30,30)"><span style="color:rgb(200,200,200)">DestroyElements</span><span style="color:rgb(180,180,180)">((</span><span style="color:rgb(86,156,214)">char</span><span style="color:rgb(180,180,180)">*)</span>alignAddr<span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">Ptr</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(200,200,200)">alignOf</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">T</span><span style="color:rgb(180,180,180)">>()),</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(86,156,214)">char</span> <span style="color:rgb(180,180,180)">*)</span><span style="color:rgb(200,200,200)">Ptr</span> <span style="color:rgb(180,180,180)">+</span> <span style="color:rgb(200,200,200)">Size</span><span style="color:rgb(180,180,180)">);</span>
</pre></div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">Sincerely,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Alexander Riccio</span><br style="font-size:12.8px"><span style="font-size:12.8px">--</span><br style="font-size:12.8px"><span style="font-size:12.8px">"Change the world or go home."</span><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8px">If left to my own devices, I will build more.</div><div style="font-size:12.8px">⁂</div></div></div></div></div></div>
</div>