You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file being read is copied into a new ArrayBuffer (line 17), which is in turn copied to a new one (line 20 with slice() Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer).
Why the same data has to be copied 2 times? If the underlying data is 1GB, that is 2GB additonal memory being used (although the intermediary 1GB will be released once the function ends). Just curious.
P.S. in our applications we tried to feed the Buffer returnd directly from ReadFileSync or the ArrayBuffer of that Buffer, all failed with this error. The only way that works is to honestly copy 2 times just like you did.
throw new Error("Object's schema was not verified against input data for MyModule");
^
Can you fix this issue by adding a line of comment before the line 12 reasoning the 2× copying?
The text was updated successfully, but these errors were encountered:
@colourful-land Frankly speaking I do not remember why I made the getCorrectBuffer. Most probably it is an issue in fs.readFileSync. I do not have a time to investigate it again. This is not an issue in ASN1js itself.
Observe the test case:
ASN1.js/test/testSuite.js
Lines 12 to 21 in 5c64632
The file being read is copied into a new ArrayBuffer (line 17), which is in turn copied to a new one (line 20 with
slice()
Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer).Why the same data has to be copied 2 times? If the underlying data is 1GB, that is 2GB additonal memory being used (although the intermediary 1GB will be released once the function ends). Just curious.
P.S. in our applications we tried to feed the Buffer returnd directly from ReadFileSync or the ArrayBuffer of that Buffer, all failed with this error. The only way that works is to honestly copy 2 times just like you did.
Can you fix this issue by adding a line of comment before the line 12 reasoning the 2× copying?
The text was updated successfully, but these errors were encountered: