Merge pull request #2 from AlexVestin/patch-1
Use size of the typed array instead of underlying bufffer
This commit is contained in:
commit
ebdf6d780c
|
@ -338,7 +338,7 @@ inline Type* getArrayData(
|
||||||
size_t offset = ta.ByteOffset();
|
size_t offset = ta.ByteOffset();
|
||||||
Napi::ArrayBuffer arr = ta.ArrayBuffer();
|
Napi::ArrayBuffer arr = ta.ArrayBuffer();
|
||||||
if (num) {
|
if (num) {
|
||||||
*num = arr.ByteLength() / sizeof(Type);
|
*num = ta.ByteLength() / sizeof(Type);
|
||||||
}
|
}
|
||||||
uint8_t *base = reinterpret_cast<uint8_t *>(arr.Data());
|
uint8_t *base = reinterpret_cast<uint8_t *>(arr.Data());
|
||||||
out = reinterpret_cast<Type *>(base + offset);
|
out = reinterpret_cast<Type *>(base + offset);
|
||||||
|
|
Loading…
Reference in New Issue