Skip to content

Commit

Permalink
add PN_IS_FFIPTR (foreign ptr)
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Jun 14, 2013
1 parent 72b203e commit 1cbe087
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/potion.h
Expand Up @@ -179,6 +179,7 @@ struct PNVtable;
#define PN_IS_PROTO(v) (PN_TYPE(v) == PN_TPROTO)
#define PN_IS_REF(v) (PN_TYPE(v) == PN_TWEAK)
#define PN_IS_METACLASS(v) (((struct PNVtable *)v)->meta == PN_NIL)
#define PN_IS_FFIPTR(p) (PN_IS_PTR(p) && !(p >= (_PN)P->mem && p <= (_PN)P->mem->old_hi))

///\class PNNumber
/// Either a PN_INT immediate object (no struct) 0x...1
Expand Down
2 changes: 1 addition & 1 deletion lib/aio.c
Expand Up @@ -211,7 +211,7 @@ aio_tcp_connect(Potion *P, PN cl, PN self, PN req, PN addr, PN port, PN cb) {
request->cb = (uv_connect_cb)PN_CLOSURE(cb);
connect_cb = (uv_connect_cb)aio_connect_cb;
}
else if (cb) connect_cb = (uv_connect_cb)PN_DATA(cb); //c-level
else if (PN_IS_FFIPTR(cb)) connect_cb = (uv_connect_cb)cb; //c-level cb loaded via ffi
else connect_cb = 0; //none
return PN_NUM(uv_tcp_connect(request, handle, ip4, connect_cb));
}
Expand Down

0 comments on commit 1cbe087

Please sign in to comment.