-
-
Save creationix/a679bfcf94371d1531db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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