#include #include "cpu_sampler.h" #include "allocation_sampler.h" NAN_MODULE_INIT(InitAll) { Nan::Set(target, Nan::New("startCpuSampler").ToLocalChecked(), Nan::GetFunction(Nan::New(cpu_profiler::StartCPUSampler)).ToLocalChecked()); Nan::Set(target, Nan::New("stopCpuSampler").ToLocalChecked(), Nan::GetFunction(Nan::New(cpu_profiler::StopCPUSampler)).ToLocalChecked()); Nan::Set(target, Nan::New("checkAllocationSampler").ToLocalChecked(), Nan::GetFunction(Nan::New(allocation_sampler::CheckAllocationSampler)).ToLocalChecked()); #if V8_MAJOR_VERSION >= 5 Nan::Set(target, Nan::New("startAllocationSampler").ToLocalChecked(), Nan::GetFunction(Nan::New(allocation_sampler::StartAllocationSampler)).ToLocalChecked()); Nan::Set(target, Nan::New("stopAllocationSampler").ToLocalChecked(), Nan::GetFunction(Nan::New(allocation_sampler::StopAllocationSampler)).ToLocalChecked()); Nan::Set(target, Nan::New("readAllocationProfile").ToLocalChecked(), Nan::GetFunction(Nan::New(allocation_sampler::ReadAllocationProfile)).ToLocalChecked()); #endif } NODE_MODULE(addon, InitAll)