00:23:06  * Tenrysquit (Read error: Connection reset by peer)
02:44:06  <creationix>I decided 64-bitops are too much trouble for now. Went for blake2s instead. https://github.com/creationix/luajit-blake2s
02:44:15  <creationix>my target hardware is usually 32-bit arm anyway
02:58:29  <creationix>protip when converting a lua string to an `uint8[?]` ctype. Don't pass in the string as the initializer unless your string will never be GCed
02:58:46  <creationix>the ctype references the string's data, but doesn't keep it from being collecte
02:59:15  <creationix>I ended up manually copying the data to prevent segfaults at gc
02:59:50  <creationix>For example `data = ffi.new('uint_t[?]', #str, str)` does work, but is dangerous.
03:00:22  <creationix>better `data = ffi.new('uint8_t[?]', #str) ffi.copy(data, str, #str)`
03:30:50  <daurnimator>creationix: why not bind e.g. strdup
03:50:07  <creationix>how would that help?
03:50:17  <creationix>I'm just trying to convert a lua string into a ctype
03:52:24  <creationix>I wonder if that segfault is a bug in luajit. It probably shouldn't crash when GCing the string
04:00:17  <daurnimator>creationix: because if you're going to make the allocation+copy, you might as well use the C function for it and not have it count towards luajit memory limit
04:00:25  <daurnimator>and raw pointers are smaller IIRC
04:00:56  <creationix>true, but I like being able to use ffi.sizeof on the ctype
04:01:06  <creationix>it's more like what rust calls a slice
04:09:19  <daurnimator>creationix: then consider having a weak table from data to string?
05:17:01  * Tenrysjoined
13:29:53  * Tenrysquit (Read error: Connection reset by peer)
14:58:47  <Soni>creationix: you use luvit on pi often?
15:35:31  * erlbot--quit (Remote host closed the connection)
15:37:12  * erlbot--joined
15:50:49  * erlbot--quit (Remote host closed the connection)
15:51:12  * erlbot--joined