Browse Source

src: update use of ExternalArrayType constants

Continuation of 4809c7a to update the use of v8::ExternalArrayType.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
v0.11.15-release
Trevor Norris 10 years ago
parent
commit
bdc2ea4d52
  1. 8
      src/node.cc
  2. 2
      src/node_buffer.cc
  3. 6
      src/smalloc.cc

8
src/node.cc

@ -120,7 +120,7 @@ using v8::TryCatch;
using v8::Uint32;
using v8::V8;
using v8::Value;
using v8::kExternalUnsignedIntArray;
using v8::kExternalUint32Array;
// FIXME(bnoordhuis) Make these per-context?
QUEUE handle_wrap_queue = { &handle_wrap_queue, &handle_wrap_queue };
@ -928,7 +928,7 @@ void SetupAsyncListener(const FunctionCallbackInfo<Value>& args) {
Environment::AsyncListener* async_listener = env->async_listener();
async_listener_flag_obj->SetIndexedPropertiesToExternalArrayData(
async_listener->fields(),
kExternalUnsignedIntArray,
kExternalUint32Array,
async_listener->fields_count());
// Do a little housekeeping.
@ -968,7 +968,7 @@ void SetupDomainUse(const FunctionCallbackInfo<Value>& args) {
Environment::DomainFlag* domain_flag = env->domain_flag();
domain_flag_obj->SetIndexedPropertiesToExternalArrayData(
domain_flag->fields(),
kExternalUnsignedIntArray,
kExternalUint32Array,
domain_flag->fields_count());
// Do a little housekeeping.
@ -993,7 +993,7 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
Local<Object> tick_info_obj = args[0].As<Object>();
tick_info_obj->SetIndexedPropertiesToExternalArrayData(
env->tick_info()->fields(),
kExternalUnsignedIntArray,
kExternalUint32Array,
env->tick_info()->fields_count());
env->set_tick_callback_function(args[1].As<Function>());

2
src/node_buffer.cc

@ -87,7 +87,7 @@ bool HasInstance(Handle<Object> obj) {
if (!obj->HasIndexedPropertiesInExternalArrayData())
return false;
v8::ExternalArrayType type = obj->GetIndexedPropertiesExternalArrayDataType();
return type == v8::kExternalUnsignedByteArray;
return type == v8::kExternalUint8Array;
}

6
src/smalloc.cc

@ -51,7 +51,7 @@ using v8::RetainedObjectInfo;
using v8::Uint32;
using v8::Value;
using v8::WeakCallbackData;
using v8::kExternalUnsignedByteArray;
using v8::kExternalUint8Array;
class CallbackInfo {
@ -304,7 +304,7 @@ void Alloc(const FunctionCallbackInfo<Value>& args) {
// it's faster to not pass the default argument then use Uint32Value
if (args[2]->IsUndefined()) {
array_type = kExternalUnsignedByteArray;
array_type = kExternalUint8Array;
} else {
array_type = static_cast<ExternalArrayType>(args[2]->Uint32Value());
size_t type_length = ExternalArraySize(array_type);
@ -385,7 +385,7 @@ void AllocDispose(Environment* env, Handle<Object> obj) {
if (data != NULL) {
obj->SetIndexedPropertiesToExternalArrayData(NULL,
kExternalUnsignedByteArray,
kExternalUint8Array,
0);
free(data);
}

Loading…
Cancel
Save