Hi Páll,

> The @nogc macro was made a long time ago, I now see:
>
>
> https://groups.google.com/forum/?fromgroups=#!searchin/julia-users/Suspending$20Garbage$20Collection$20for$20Performance...good$20idea$20or$20bad$20idea$3F/julia-users/6_XvoLBzN60/nkB30SwmdHQJ
>

This is a very informative thread. Thank you for pointing it out!
 

>
> I'm not saying disabling the GC is preferred, just that the macro has been 
> done to do it had already been done.
>
> Karpinski has his own exception variant a little down the thread with "you 
> really want to put a try-catch around it". I just changed that variant so 
> it can be called recursively (and disabled try-catch as it was broken):
>
> macro nogc(ex)
>          quote
>            #try
>              local pref = gc_enable(false)
>              local val = $(esc(ex))
>            #finally
>              gc_enable(pref)
>            #end
>            val
>          end
>        end
>
>
>
  -Islam 

Reply via email to