TooTallNate / ref

Turn Buffer instances into "pointers"
http://tootallnate.github.com/ref
453 stars 141 forks source link

[question] read int pointer #69

Closed DevSide closed 7 years ago

DevSide commented 7 years ago
const intPtr = ref.refType(ref.types.int);

const lib = ffi.Library('myLib', {
  'get': [intPtr]
})

const myIntPtr = lib.get();

myIntPtr.ref(); // i get the buffer address
myIntPtr.deref() // nothing

I'm trying to get the value behind the pointer, how can i do this ?