Skip to content

Instantly share code, notes, and snippets.

@creationix
Created March 22, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creationix/a679bfcf94371d1531db to your computer and use it in GitHub Desktop.
Save creationix/a679bfcf94371d1531db to your computer and use it in GitHub Desktop.
class uvHandle: public CWrapper {
public:
uv_handle_t* handle;
Handle<Object> obj;
uvHandle(size_t size, Object* prototype) {
if (prototype) {
obj.Wrap(prototype->Clone());
} else {
obj.Wrap(Object::New());
}
handle = (uv_handle_t*)malloc(size);
}
~uvHandle() {
free(handle);
delete obj;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment