diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-30 15:19:48 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-07-30 15:19:48 +0200 |
commit | b8c04b921b626edd4201f805d0feb384c8e91ea7 (patch) | |
tree | 3266e137f154fccf8b8f33ff4904f8aa0e8e8e25 /src/node_os.cc | |
parent | dc9acd4faeba1aade414bdd8da28f30b16773575 (diff) | |
parent | 6327d67be3a939b1ce6ac8541504b1f6fc338fd9 (diff) | |
download | android-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.tar.gz android-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.tar.bz2 android-node-v8-b8c04b921b626edd4201f805d0feb384c8e91ea7.zip |
Merge remote-tracking branch 'origin/v0.10'
Conflicts:
AUTHORS
ChangeLog
deps/uv/ChangeLog
deps/uv/src/version.c
deps/uv/src/win/fs.c
src/node.cc
src/node_crypto.cc
src/node_os.cc
src/node_version.h
Diffstat (limited to 'src/node_os.cc')
-rw-r--r-- | src/node_os.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/node_os.cc b/src/node_os.cc index 5b6e30b370..143dd60354 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -136,24 +136,26 @@ static void GetCPUInfo(const FunctionCallbackInfo<Value>& args) { Local<Array> cpus = Array::New(); for (i = 0; i < count; i++) { + uv_cpu_info_t* ci = cpu_infos + i; + Local<Object> times_info = Object::New(); times_info->Set(String::New("user"), - Integer::New(cpu_infos[i].cpu_times.user, node_isolate)); + Number::New(node_isolate, ci->cpu_times.user)); times_info->Set(String::New("nice"), - Integer::New(cpu_infos[i].cpu_times.nice, node_isolate)); + Number::New(node_isolate, ci->cpu_times.nice)); times_info->Set(String::New("sys"), - Integer::New(cpu_infos[i].cpu_times.sys, node_isolate)); + Number::New(node_isolate, ci->cpu_times.sys)); times_info->Set(String::New("idle"), - Integer::New(cpu_infos[i].cpu_times.idle, node_isolate)); + Number::New(node_isolate, ci->cpu_times.idle)); times_info->Set(String::New("irq"), - Integer::New(cpu_infos[i].cpu_times.irq, node_isolate)); + Number::New(node_isolate, ci->cpu_times.irq)); Local<Object> cpu_info = Object::New(); - cpu_info->Set(String::New("model"), String::New(cpu_infos[i].model)); - cpu_info->Set(String::New("speed"), - Integer::New(cpu_infos[i].speed, node_isolate)); + cpu_info->Set(String::New("model"), String::New(ci->model)); + cpu_info->Set(String::New("speed"), Number::New(node_isolate, ci->speed)); cpu_info->Set(String::New("times"), times_info); - (*cpus)->Set(i,cpu_info); + + (*cpus)->Set(i, cpu_info); } uv_free_cpu_info(cpu_infos, count); |