sv.data = "">
local function db_add(key, value)
sk.len = string.len(key)
ffi.copy(sk.data, key)
sv.len = string.len(value)
ffi.copy(sv.data, value)
print("add : " .. ffi.string(sk.data) .. " / " .. ffi.string(sv.data))
end
for n = 1,1000 do
db_add("key" .. n, "value" .. n)
end
***
This program print the key / value from 1 to 141 without problem but not the 142 key and do a segmentation fault at key 170.
Theses values are for my Ubuntu Box and may change on other box.
I am doing something wrong or there's a bug in LuaJIT FFI ?
Thanks in advance, Olivier.