我今天新建了一个空项目,在MyApp:onCreate函数中加入如下测试代码:
local verbo = require(“jit.v”)
verbo.start()
print("[jit] version",jit.version)
print("[jit] version_num",jit.version_num)
print("[jit] os",jit.os)
print("[jit] arch",jit.arch)
print("[jit] status on ", jit.status())
local x = 0
for i=1,1000000 do
x = x + 1
end
print("[jit] x",x)
jit.off()
print("[jit] status off", jit.status())
x = 0
for i=1,1000000 do
x = x + 1
end
print("[jit] x",x)
结果发现运行时,仍然是有大量的异常打印,如下:
03-28 19:28:00.355 4299 4316 D cocos2d-x debug info: [LUA-print] 1[TRACE — “app/MyApp.lua”:21 – failed to allocate mcode memory at “app/MyApp.lua”:22]
03-28 19:28:00.355 4299 4316 D cocos2d-x debug info:
03-28 19:28:00.355 4299 4316 D cocos2d-x debug info: [LUA-print] 7[TRACE flush]
==============================
请问这个代表什么情况,是否说明并未在luajit正常模式下运行?