<div dir="ltr">I suggest adding a way to override a @nogc function for debugging purposes:<div><br><div>suppose we need to *temporarily* debug / instrument a function marked as @nogc (myfun) by adding some piece of code that may allocate (quick and dirty debugging). Unfortunately, in DIP60 we can't just temporarily remove the @nogc attribute as myfun may be called by many other @nogc functions and changing all those attributes would be too complex. </div>
<div><br></div><div>With the propose override, we can just recompile with a flag ; how to do that is implementation detail but here's an option:</div><div><br></div><div>dmd -allow_gc_in_nogc fun.d</div><div><br></div>
<div>@nogc myfun(){<br></div><div><br></div><div>//temporary for debugging/instrumentation</div><div>@gc{</div><div>//code that can allocate</div><div>}</div><div><br></div><div>}<br></div><div><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 10:01 AM, Walter Bright via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="http://wiki.dlang.org/DIP60" target="_blank">http://wiki.dlang.org/DIP60</a><br>
<br>
Start on implementation:<br>
<br>
<a href="https://github.com/D-Programming-Language/dmd/pull/3455" target="_blank">https://github.com/D-<u></u>Programming-Language/dmd/pull/<u></u>3455</a><br>
</blockquote></div><br></div>