Isaac Clark
Isaac Clark

Reputation: 39

Is it possible to block functions from compiling by using luajit?

So im debugging my lua scripts now, and i here i came to question - is it possible to block function from compiling by using jit.attach? (something like this)

local function jitcatch(dat)
    local sour = string.sub( jit.util.funcinfo(dat).source, 2 )
    if sour == 'test.lua' then jit.off(dat) end
end
jit.attach( jitcatch, 'bc' )

Upvotes: 0

Views: 350

Answers (1)

Nicolás Abram
Nicolás Abram

Reputation: 333

jit.off(true, true) will disable jit compiling for the current script. jit.off(function) will disable jit compiling for a specific function.

Upvotes: 2

Related Questions