Skip to content

Instantly share code, notes, and snippets.

View igormunkin's full-sized avatar
🐧
Pull my code it's free

Igor Munkin igormunkin

🐧
Pull my code it's free
View GitHub Profile
@igormunkin
igormunkin / 3.patch
Last active May 15, 2021 15:38
Debug Mach-O unwind info on ARM64
diff --git a/src/Makefile b/src/Makefile
index fdf04b6e..f4d9573e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -36,7 +36,7 @@ CC= $(DEFAULT_CC)
# to slow down the C part by not omitting it. Debugging, tracebacks and
# unwinding are not affected -- the assembler part has frame unwind
# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
-CCOPT= -O2 -fomit-frame-pointer
+#CCOPT= -O2 -fomit-frame-pointer
@igormunkin
igormunkin / bench.lua
Last active September 7, 2020 20:15
gh-1700
local fiber = require('fiber')
local clock = require('clock')
local fibers, iterations = (tonumber(arg[1]) or 1e1), (tonumber(arg[2]) or 1e4)
io.write(("#1700 bench: fibers: %d; iterations: %d"):format(fibers, iterations))
local GLOBAL = fibers
local f = { }
for i = 1, fibers do
@igormunkin
igormunkin / callee.lua
Created June 19, 2020 19:22
GC pressure benchmark
local G = 0
function incG() G = G + 1 end
bench = {
start = function()
print(collectgarbage('count'))
collectgarbage('collect')
collectgarbage('stop')
return collectgarbage('count')
end,
@igormunkin
igormunkin / 4252-w-sink.dump
Last active May 23, 2020 13:01
Trace dumps and reproducer for LuaJIT #548
---- TRACE 1 start 4252.lua:54
0011 KPRI 8 0
0012 MOV 9 4
0013 MOV 10 5
0014 MOV 11 6
0015 CALL 9 3 3
0000 . FUNCF 6 ; 4252.lua:5
0001 . TGETS 3 0 0 ; "gen"
0002 . MOV 4 1
0003 . MOV 5 2
@igormunkin
igormunkin / .gitignore
Last active December 15, 2020 11:54
LuaJIT stack unwinding with JIT trace within it
libtest.so
dump.out