{ "id": "175364", "key": "TIMOB-28039", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2020-07-23T17:11:27.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "58573", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "175365", "key": "TIMOB-28040", "fields": { "summary": "iOS: Make use of shared underlying byte array in Ti.Buffer", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": null, "updated": "2020-07-23T17:11:44.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Our current API for Ti.Buffer makes use of a {{byte[]}}. While https://github.com/appcelerator/titanium_mobile/pull/11810 helps us to copy those bytes out to an {{ArrayBuffer}} on the JS side (though Ti.Blob), we should consider retooling {{Ti.Buffer}} to use a {{ByteBuffer}} with direct allocation pointing to the same exact memory shared by the JS engine's {{ArrayBuffer}}.\r\n\r\nThis blog post makes reference to how the J2V8 project did exactly this: https://eclipsesource.com/blogs/2016/07/25/typedarrays-sharing-memory-between-v8-and-java/\r\n\r\nEssentially this would involve Ti.Buffer wrapping a {{ByteBuffer}} rather than a {{byte[]}}. We could then read/write to the bytes from the native or JS side **without** crossing the JNI/V8 native bridge.", "attachment": [], "flagged": false, "summary": "Android: Make use of shared underlying byte array in Ti.Buffer", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }