Closed melloc closed 8 years ago
@davepacheco Would you be able to take a look at this at some point? (Asking because you are one of the owners).
@davepacheco I've updated the README based on your suggested paragraphs. Let me know if you think it can be improved.
(There was a minor issue with one of the examples I wrote. I've fixed it and updated the branch.)
I've tested this on SmartOS and Mac OS X. Once I added the fix for chrisa/libusdt#12, all tests passed on Mac OS X and SmartOS. Results are below.
With this change, extra arguments can be passed to the callback given to
.fire()
, similar to how functions likesetImmediate
work. This means that a single top-level function can be passed to.fire()
, instead of constructing a new closure each time you call it, which takes additional time and memory. (And might be for naught if the probe isn't enabled.) I haven't done much C++ or Nan before, so if anything here can be improved, please let me know.This compiles and runs on SmartOS and Mac OS X. All of the tests, including the two I've added, pass on both platforms (except for the 2 JSON ones which get skipped on Mac OS X). Additionally, I've run the DTrace tests in trentm/node-bunyan using these changes.