<br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 11:48 AM, Renato Golin <span dir="ltr"><<a href="mailto:rengolin@systemcall.org">rengolin@systemcall.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 16 June 2011 20:57, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
>> I see, maybe you could leave your C implementation as a fall back.<br>
><br>
> Not easy, because it will require a fallback code in the run time library.<br>
> But yes, possible.<br>
<br>
</div>I was thinking more of a build-time fall back, when you're choosing<br>
the platform...<br>
<br>
#ifdef __x86_arch<br>
... specific<br>
#else<br>
C-generic<br>
#endif<br></blockquote><div><br></div><div>Sure, this is possible. But we'll need  two such blocks: one in the LLVM instrumentation and one (matching) in the run-time. </div><div>I am rather reluctant to add 'generic' code that handles unknown/untested platforms because the memory mapping is very platform specific anyway. </div>
<div>For extreme performance ASAN uses the fixed memory-to-shadow mapping (addr>>3)+offset. I guess there are plenty of platforms where this mapping won't work or will require different offset.</div><div><br></div>
<div>--kcc </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
<br>
<br>
> Agree. We've been adding APPLE code just recently. Time to split.<br>
> I afraid we'll have to keep a single .cc file and add .h files for os/arch<br>
> specific code to keep inlining under manual control (I don't want to reply<br>
> on the compiler doing cross-cc-file inlining for me).<br>
<br>
</div>You might end up with a lot of redundancy.<br>
<br>
If inlining is not working as you'd expect, a compile-time static<br>
include (is ugly, but) would be better than to have the same code over<br>
and over.<br>
<br>
<br>
cheers,<br>
<font color="#888888">--renato<br>
</font></blockquote></div><br>