Skip to content

Commit d8da5e6

Browse files
committed
Some small fixes for lineTicks in cpu profiler
1 parent 483eea5 commit d8da5e6

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/cpu_profile_node.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ namespace nodex {
1313

1414
uint32_t ProfileNode::UIDCounter = 1;
1515

16-
#if (NODE_MODULE_VERSION >= 42)
17-
static Handle<Value> GetLineTicks(const CpuProfileNode* node) {
16+
#if (NODE_MODULE_VERSION >= 42)
17+
static ProfileNode::Handle<Value> GetLineTicks(const CpuProfileNode* node) {
1818
NanEscapableScope();
1919

20-
unsigned int count = node->GetHitLineCount();
20+
uint32_t count = node->GetHitLineCount();
2121
v8::CpuProfileNode::LineTick *entries = new v8::CpuProfileNode::LineTick[count];
2222
bool result = node->GetLineTicks(entries, count);
2323

2424
Local<Value> lineTicks;
2525
if (result) {
2626
Local<Array> array = NanNew<Array>(count);
27-
for (unsigned int index = 0; index < count; index++) {
27+
for (uint32_t index = 0; index < count; index++) {
2828
Local<Object> tick = NanNew<Object>();
2929
tick->Set(NanNew<String>("line"), NanNew<Integer>(entries[index].line));
3030
tick->Set(NanNew<String>("hitCount"), NanNew<Integer>(entries[index].hit_count));
@@ -69,7 +69,7 @@ namespace nodex {
6969
profile_node->Set(NanNew<String>("children"), children);
7070

7171
#if (NODE_MODULE_VERSION >= 42)
72-
auto lineTicks = GetLineTicks(node);
72+
Handle<Value> lineTicks = GetLineTicks(node);
7373
if (!lineTicks->IsNull()) {
7474
profile_node->Set(NanNew<String>("lineTicks"), lineTicks);
7575
}

src/cpu_profile_node.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
namespace nodex {
88

99
class ProfileNode {
10-
public:
11-
static v8::Handle<v8::Value> New(const v8::CpuProfileNode* node);
12-
static uint32_t UIDCounter;
10+
public:
11+
static v8::Handle<v8::Value> New(const v8::CpuProfileNode* node);
12+
static uint32_t UIDCounter;
13+
14+
private:
15+
#if (NODE_MODULE_VERSION >= 42)
16+
static v8::Handle<v8::Value> GetLineTicks(const v8::CpuProfileNode* node);
17+
#endif
1318
};
1419

1520
}

0 commit comments

Comments
 (0)