justincormack / ljsyscall

LuaJIT Unix syscall FFI
http://www.myriabit.com/ljsyscall/
Other
441 stars 54 forks source link

mach_absolute_time on osx #168

Closed daurnimator closed 10 years ago

daurnimator commented 10 years ago

Want to use mach_absolute_time on osx to get high res time.

justincormack commented 10 years ago

Added, completely untested as I need to go will test later. Should also add the other functions from mach/mach_time.h as well.

daurnimator commented 10 years ago

Thanks

host_get_clock_service, clock_get_time, mach_port_deallocate seem to be required for an equivalent to CLOCK_REALTIME

example here: https://gist.github.com/jbenet/1087739

justincormack commented 10 years ago

ok, havent had a chance to write a test yet, but all the functions should be there.

I think mach ports should be garbage collected with mach_port_deallocate() though.

daurnimator commented 10 years ago

I think mach ports should be garbage collected with mach_port_deallocate() though.

Sounds sensible

justincormack commented 10 years ago

ok, there is a test now.

justincormack commented 10 years ago

ok, I think this issue is ok now. There is probably a bunch of other osx stuff thats missing, suggestions appreciated...