René's URL Explorer Experiment


Title: feat(runtime): arrays WinRT hands back, String[]/object arrays, boxed-argument leak by triniwiz · Pull Request #44 · NativeScript/windows · GitHub

Open Graph Title: feat(runtime): arrays WinRT hands back, String[]/object arrays, boxed-argument leak by triniwiz · Pull Request #44 · NativeScript/windows

X Title: feat(runtime): arrays WinRT hands back, String[]/object arrays, boxed-argument leak by triniwiz · Pull Request #44 · NativeScript/windows

Description: Follows #41. Arrays now convert in both directions for every element type, on both engines, including arrays WinRT allocates and hands back. Before, those were refused when the call was built ("Unsupported array return type"). Three commits: 1. Arrays WinRT hands back A received array takes two ABI slots, UINT32* length and T** data. MethodCall and PropertyCall lay these out for: array return values and array-typed property getters, which land in the call's return buffer; ByRef T[] parameters, as two out slots. After the call, (length, data) is converted and the CoTaskMem array freed. The element type comes from classify_return, through the new ReturnKind::Array { element, element_type, size }: element JS value primitives (UInt8 … Double, Boolean, Char16, enums) typed array of the matching kind, the same kinds interop.Array.create returns String array of strings classes, interfaces, Object array of wrappers (null for null) structs, Guid array of struct objects String and object elements are taken over by the conversion, so nothing is left to release. Out parameters behave as they do for other types: classic accepts interop.out() or returns [result, ...outs]; napi needs interop.out(). const out = interop.out(); CryptographicBuffer.CopyToByteArray(buffer, out); // out.value: Uint8Array Windows.Graphics.Display.DisplayServices.FindAll(); // [{ Value: 65537 }] new ListBoxAutomationPeer(list).GetSelection(); // [wrapper, wrapper] certificateExtension.Value; // Uint8Array Boxed arrays: IReferenceArray values (from PropertyValue.Create*Array, a PropertySet, settings, device properties) unbox the way boxed scalars already do, through IPropertyValue.Get*Array and the same conversion. In the other direction, an Object parameter boxes these with PropertyValue, so a returned array can be passed back: typed arrays, which box as the matching IReferenceArray; plain arrays whose elements are all strings, all numbers (Int32[] when they're all 32-bit integers, Double[] otherwise), all booleans, or all WinRT objects (or null). 2. Boxed Object arguments no longer leak Every JS value boxed for an Object parameter (strings, numbers, booleans, struct shapes, and now arrays) used to forget its reference, so each argument leaked its box. Each call now opens a BoxedArgs scope, and the boxes made while parsing its arguments are released when the call returns. A call made during argument parsing (e.g. from a getter) opens its own scope and releases only its own boxes. Inserting the same values into a PropertySet 200k times (napi, memory after GC): value before after 2 KB string +1087 MB +262 MB Float64Array(256) +693 MB +262 MB number +285 MB +262 MB existing WinRT object (no boxing) +262 MB +261 MB The ~262 MB the no-boxing row still shows isn't a leak. It's napi finalizers waiting for the event loop, which this synchronous loop never yields to. With the loop yielding between 50k-call batches, memory levels off after a few batches. 3. String[] and object arrays passed in or filled Passed in (PropertyValue.CreateStringArray, IVector.ReplaceAll, …): a JS array becomes HSTRINGs, or objects queried to the element's interface. They're released after the call. Filled by the callee (IVector.GetMany): the caller passes a JS array as long as the slots it wants, and the results are written back into that array. interop.Array.create('String', n), ('Object', n) or ('Windows.Data.Json.IJsonValue', n) returns an array of nulls for this. Fill parameters are recognized by the [out] param attribute (ParameterDeclaration::is_fill_array). GenericMethodCall, which is only used for open generic interfaces, refuses these arrays rather than passing them as bytes. Testing Rust unit tests: array classification and layout string/object element resolution a box/unbox round trip through PropertyValue that frees the returned HSTRINGs End-to-end, 24/24 on Node with windows-napi, 23/23 on classic V8 (the XAML check needs a XAML host): out byte[], including an empty one struct-array return boxed arrays of every primitive kind String[]/Object[] passed in, and round trips through PropertySet IVector.ReplaceAll/GetMany, and GetMany returning the filled count IVector.ReplaceAll/GetMany CertificateExtension.Value set and get ListBoxAutomationPeer.GetSelection() in a live XamlWindow Existing suites: windows-napi npm test: 442/442 the #41 end-to-end checks: 27/27 napi, 24/24 classic the events checks: 26/26 cargo test -p runtime --lib: the same failures as main Not covered: IReferenceArray.Value called directly on an interface instance. It goes through the same property path, but boxed arrays now unbox before JS can reach that member, so I couldn't test it. Struct arrays passed in (e.g. PropertyValue.CreatePointArray).

Open Graph Description: Follows #41. Arrays now convert in both directions for every element type, on both engines, including arrays WinRT allocates and hands back. Before, those were refused when the call was built (&quo...

X Description: Follows #41. Arrays now convert in both directions for every element type, on both engines, including arrays WinRT allocates and hands back. Before, those were refused when the call was built (&...

Opengraph URL: https://github.com/NativeScript/windows/pull/44

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:77e81f19-51ad-0f3e-63d8-93cf5581b253
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA238:785A9:20ED5C1:29B9621:6B01713E
html-safe-noncec0334458d80b1330391c8308ced3c4caf7c985f112c604dceeef37fc0bfb46b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjM4Ojc4NUE5OjIwRUQ1QzE6MjlCOTYyMTo2QjAxNzEzRSIsInZpc2l0b3JfaWQiOiIyMDI2NDQyMjk3MzQzODMyMzgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacd00ed24909c0981f1573d5f77b4e02e74dae2db8d40aeceb6011eee384d79d8f
hovercard-subject-tagpull_request:5184734606
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/windows/pull/44/files
twitter:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
og:image:altFollows #41. Arrays now convert in both directions for every element type, on both engines, including arrays WinRT allocates and hands back. Before, those were refused when the call was built (&quo...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/windows git https://github.com/NativeScript/windows.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id373653886
octolytics-dimension-repository_nwoNativeScript/windows
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id373653886
octolytics-dimension-repository_network_root_nwoNativeScript/windows
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/windows/pull/44/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fwindows%2Fpull%2F44%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fwindows%2Fpull%2F44%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fwindows
Reloadhttps://github.com/NativeScript/windows/pull/44/files
Reloadhttps://github.com/NativeScript/windows/pull/44/files
Reloadhttps://github.com/NativeScript/windows/pull/44/files
NativeScripthttps://github.com/NativeScript
windowshttps://github.com/NativeScript/windows
Codehttps://github.com/NativeScript/windows
Issueshttps://github.com/NativeScript/windows/issues
Pull requestshttps://github.com/NativeScript/windows/pulls
Actionshttps://github.com/NativeScript/windows/actions
Projectshttps://github.com/NativeScript/windows/projects
Security and qualityhttps://github.com/NativeScript/windows/security
Insightshttps://github.com/NativeScript/windows/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2Fwindows%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2Fwindows%2Fissues%2Fnew%2Fchoose
triniwizhttps://github.com/triniwiz
mainhttps://github.com/NativeScript/windows/tree/main
feat/winrt-received-arrayshttps://github.com/NativeScript/windows/tree/feat/winrt-received-arrays
Conversation 1 https://github.com/NativeScript/windows/pull/44
Commits 3 https://github.com/NativeScript/windows/pull/44/commits
Checks 3 https://github.com/NativeScript/windows/pull/44/checks
Files changed https://github.com/NativeScript/windows/pull/44/files
Please reload this pagehttps://github.com/NativeScript/windows/pull/44/files
feat(runtime): arrays WinRT hands back, String[]/object arrays, boxed-argument leak https://github.com/NativeScript/windows/pull/44/files#top
Show all changes 3 commits https://github.com/NativeScript/windows/pull/44/files
c8f2046 feat(runtime): arrays WinRT hands back triniwiz Nov 6, 2026 https://github.com/NativeScript/windows/pull/44/commits/c8f20469d9b6539895046f6b2c8543f888bcbf9e
c8b4c22 fix(runtime): release values boxed for Object arguments triniwiz Nov 6, 2026 https://github.com/NativeScript/windows/pull/44/commits/c8b4c22fa19474f3b2b9dd5ff71544ac0243d446
6038bfb feat(runtime): String[] and object arrays, array properties triniwiz Nov 6, 2026 https://github.com/NativeScript/windows/pull/44/commits/6038bfb64654fe501de87310e2897e836287023e
Clear filters https://github.com/NativeScript/windows/pull/44/files
Please reload this pagehttps://github.com/NativeScript/windows/pull/44/files
Please reload this pagehttps://github.com/NativeScript/windows/pull/44/files
generic_method_call.rs https://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
helpers.rs https://github.com/NativeScript/windows/pull/44/files#diff-b808d86633f8a3ca7923bd79eb98c11bc3f0828e00cf7c61e53929da22c29646
interop_array.js https://github.com/NativeScript/windows/pull/44/files#diff-77e9df3a48fc049405c2e916905a318a1c2ee2df6f521f6b21e9d7bcd3d7c6b3
lib.rs https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
method_call.rs https://github.com/NativeScript/windows/pull/44/files#diff-d4b5f479d079a3be6b69b2f97b43385a30a402a0a07b0e55d710e1889a5037b7
invoke.rs https://github.com/NativeScript/windows/pull/44/files#diff-a71b6d3125c86a3f68d6b2bec8999f8cb26b0a9d8cd09416ab3cc6157894863b
value.rs https://github.com/NativeScript/windows/pull/44/files#diff-afbb6e4c6b2910a255031ed59d437805332e450e97f8741c88a79a31ee633ce9
ns_proxy.rs https://github.com/NativeScript/windows/pull/44/files#diff-4c3e3ecccee261330328e252ad6b51d285d51f9e847767f39ee182b9ed982346
property_call.rs https://github.com/NativeScript/windows/pull/44/files#diff-ab9dad0dc50de9a4d6e7e30abb9268e2699ff54930bae109f36f873815b196ef
value.rs https://github.com/NativeScript/windows/pull/44/files#diff-bfca47ce3812b16f4018e8b00fe715af33c5d5c2eb0e556df3de3bc09ef604a6
nswinrt-helpers.d.ts https://github.com/NativeScript/windows/pull/44/files#diff-12dfb999ac845b06c0cee34ad31fd7f8f8516c7994eeac8d70aa44e4d3043668
runtime/src/generic_method_call.rshttps://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
View file https://github.com/NativeScript/windows/blob/6038bfb64654fe501de87310e2897e836287023e/runtime/src/generic_method_call.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/windows/pull/44/{{ revealButtonHref }}
https://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
https://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
https://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
https://github.com/NativeScript/windows/pull/44/files#diff-71421984375b6b9dd63bc0908d9ec6c463141a97518c21c2e9d5b51640f6024c
runtime/src/helpers.rshttps://github.com/NativeScript/windows/pull/44/files#diff-b808d86633f8a3ca7923bd79eb98c11bc3f0828e00cf7c61e53929da22c29646
View file https://github.com/NativeScript/windows/blob/6038bfb64654fe501de87310e2897e836287023e/runtime/src/helpers.rs
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/NativeScript/windows/pull/44/files
runtime/src/js/interop_array.jshttps://github.com/NativeScript/windows/pull/44/files#diff-77e9df3a48fc049405c2e916905a318a1c2ee2df6f521f6b21e9d7bcd3d7c6b3
View file https://github.com/NativeScript/windows/blob/6038bfb64654fe501de87310e2897e836287023e/runtime/src/js/interop_array.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/windows/pull/44/{{ revealButtonHref }}
https://github.com/NativeScript/windows/pull/44/files#diff-77e9df3a48fc049405c2e916905a318a1c2ee2df6f521f6b21e9d7bcd3d7c6b3
https://github.com/NativeScript/windows/pull/44/files#diff-77e9df3a48fc049405c2e916905a318a1c2ee2df6f521f6b21e9d7bcd3d7c6b3
runtime/src/lib.rshttps://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
View file https://github.com/NativeScript/windows/blob/6038bfb64654fe501de87310e2897e836287023e/runtime/src/lib.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/windows/pull/44/{{ revealButtonHref }}
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
https://github.com/NativeScript/windows/pull/44/files#diff-0ec06ea58bd455f09ce6b3bb4c2c1c0d37bda51c1e1be2151c560c9c973959ec
Please reload this pagehttps://github.com/NativeScript/windows/pull/44/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.