Title: Problem using JSTypedArray · Issue #37 · phoboslab/JavaScriptCore-iOS · GitHub
Open Graph Title: Problem using JSTypedArray · Issue #37 · phoboslab/JavaScriptCore-iOS
X Title: Problem using JSTypedArray · Issue #37 · phoboslab/JavaScriptCore-iOS
Description: Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help. I read through the blog here and figured it out it could not solve my problem, but wondering if you might have ran into the same problem. I ...
Open Graph Description: Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help. I read through the blog here and figured it out it could not solve my problem, but wondering if you ...
X Description: Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help. I read through the blog here and figured it out it could not solve my problem, but wondering if you ...
Opengraph URL: https://github.com/phoboslab/JavaScriptCore-iOS/issues/37
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problem using JSTypedArray","articleBody":"Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help.\r\n\r\nI read through the blog [here](https://phoboslab.org/log/2015/11/the-absolute-worst-way-to-read-typed-array-data-with-javascriptcore) and figured it out it could not solve my problem, but wondering if you might have ran into the same problem. I used an `ArrayBuffer` to transfer large amount of data from js to C, but the result is sometimes wrong. When I set a value in js, the underlying memory is untouched. for example\r\n\r\n```js\r\nlet arr = ... // arr is a Uint8Array\r\narr[0] = 1;\r\narr[1] = 2;\r\narr[2] = 3;\r\narr[3] = 4;\r\nconsole.log(arr[0], arr[1], arr[2], arr[3]); // 1 2 3 4\r\nconsole.log('' + arr); // something other than 1,2,3,4\r\nconsole.log(arr[0], arr[1], arr[2], arr[3]); // something other than 1 2 3 4\r\n```\r\n\r\nIt happens randomly, cannot be reproduced every time. The key is that when I made a native call, such as passing the TypedArray object into a native function, or calling `toString` of the typed array, the array then acts normally. Even if the native function does nothing with the array (such as `JSObjectGetTypedArrayBytesPtr`).\r\n\r\nI sincerely hope that you could give some guidance about how to avoid this bug, many thanks.","author":{"url":"https://github.com/kyriosli","@type":"Person","name":"kyriosli"},"datePublished":"2019-01-07T08:10:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/37/JavaScriptCore-iOS/issues/37"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:273ea193-21f0-ede7-4730-0db40ac6bccc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8824:2F377C:202A784:2AFDFD3:69705B43 |
| html-safe-nonce | d24885508930c889e33197ccdf3e00050f1c5ce608ecddf5a22dd06ee67d55c3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODI0OjJGMzc3QzoyMDJBNzg0OjJBRkRGRDM6Njk3MDVCNDMiLCJ2aXNpdG9yX2lkIjoiMzA4NjE4NDAwOTY5NjMwMzkzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1f54bffb4032900c73e2d5b54f59087ca0f3105fb454dcb79ecec24c2dee4fc8 |
| hovercard-subject-tag | issue:396386840 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phoboslab/JavaScriptCore-iOS/37/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ce024ddc04afeeb58ecab8b69a4e4941f0ee8b1011cd656146814e7b33d7d83e/phoboslab/JavaScriptCore-iOS/issues/37 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ce024ddc04afeeb58ecab8b69a4e4941f0ee8b1011cd656146814e7b33d7d83e/phoboslab/JavaScriptCore-iOS/issues/37 |
| og:image:alt | Hello, I ran into a problem using JSTypedArray and was wondering if you could give me some help. I read through the blog here and figured it out it could not solve my problem, but wondering if you ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kyriosli |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/phoboslab/JavaScriptCore-iOS git https://github.com/phoboslab/JavaScriptCore-iOS.git |
| octolytics-dimension-user_id | 443987 |
| octolytics-dimension-user_login | phoboslab |
| octolytics-dimension-repository_id | 6971467 |
| octolytics-dimension-repository_nwo | phoboslab/JavaScriptCore-iOS |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 6971467 |
| octolytics-dimension-repository_network_root_nwo | phoboslab/JavaScriptCore-iOS |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width