xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

[runtime] Use calloc instead of malloc. #20692

Closed rolfbjarne closed 3 weeks ago

rolfbjarne commented 3 weeks ago

It's safer, since the returned memory is zero-initialized.

Also add tests.

github-actions[bot] commented 3 weeks ago

:warning: Your code has been reformatted. :warning:

If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.

If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).

vs-mobiletools-engineering-service2 commented 3 weeks ago

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes) * ~iOS~ (no change detected) * ~tvOS~ (no change detected) * ~watchOS~ (no change detected) * ~macOS~ (no change detected)
NET (empty diffs) * ~iOS~: (empty diff detected) * ~tvOS~: (empty diff detected) * ~MacCatalyst~: (empty diff detected) * ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/ios-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/ecd234bbe0a730943be6a49f58ef8709) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/tvos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/dc336c89aae553327a900455146c6733) (No breaking changes) * watchOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/watchos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/c68f2d4cde9a01c17b924e7fa86fe524) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/mac-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/c3f65bcf2b1ba6b7ee4bf45434c2e699) (No breaking changes)
.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/760ba17256f5cc71f3ab43c748b542e9) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/f61cee9a22371933cd1e7c974273c1b0) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/Microsoft.MacCatalyst.Ref/ref/net8.0/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/aadc8b62354d88c2da7564c13005f966) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/5d2c6bf951f84e1f845d7f3627155755) (No breaking changes) * Microsoft.iOS vs Microsoft.MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/iOS-MacCatalyst-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/6e63c5fcd78c7ef8938bdd128ed838fa)
Legacy Xamarin (stable) vs .NET * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/d211f24015c567cf5c76f4e0545e9b50) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/d42952b8a3ce6959ed4028b202445d8b) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240606.14/9687330-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/38bc0c41c9ffdae05ca748e302be4707)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: f302260d13efdcfb0d6402fee67d355c0fca8383 [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:books: [PR Build] Artifacts :books:

Packages generated

View packages * [xamarin.ios-17.3.0.493.pkg](https://dl.internalx.com/wrench/merge/cd567d4b79367ec0381b45d8931b4bb1bf40715e/9687330/package/xamarin.ios-17.3.0.493.pkg) * [xamarin.mac-9.3.0.493.pkg](https://dl.internalx.com/wrench/merge/cd567d4b79367ec0381b45d8931b4bb1bf40715e/9687330/package/xamarin.mac-9.3.0.493.pkg)

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:computer: [PR Build] Tests on macOS X64 - Mac Sonoma (14) passed :computer:

:white_check_mark: All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:computer: [PR Build] Tests on macOS M1 - Mac Ventura (13) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:computer: [PR Build] Tests on macOS M1 - Mac Monterey (12) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: f302260d13efdcfb0d6402fee67d355c0fca8383 [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:fire: [CI Build] Test results :fire:

Test results

:x: Tests failed on VSTS: test results

1 tests crashed, 0 tests failed, 167 tests passed.

Failures

:x: dotnettests tests (tvOS)

:fire: Failed catastrophically on VSTS: test results - dotnettests_tvos (no summary found).

Html Report (VSDrops) Download

Successes

:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: install-source: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 65 tests passed. Html Report (VSDrops) Download :white_check_mark: mac-binding-project: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: mmp: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mononative: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (watchOS): All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mtouch: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: xammac: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: f302260d13efdcfb0d6402fee67d355c0fca8383 [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: f302260d13efdcfb0d6402fee67d355c0fca8383 [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:books: [PR Build] Artifacts :books:

Packages generated

View packages * [xamarin.ios-17.3.0.498.pkg](https://dl.internalx.com/wrench/merge/aae2af2766a8d285d125199c7e16610b4359424c/9693755/package/xamarin.ios-17.3.0.498.pkg) * [xamarin.mac-9.3.0.498.pkg](https://dl.internalx.com/wrench/merge/aae2af2766a8d285d125199c7e16610b4359424c/9693755/package/xamarin.mac-9.3.0.498.pkg)

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 3 weeks ago

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes) * ~iOS~ (no change detected) * ~tvOS~ (no change detected) * ~watchOS~ (no change detected) * ~macOS~ (no change detected)
NET (empty diffs) * ~iOS~: (empty diff detected) * ~tvOS~: (empty diff detected) * ~MacCatalyst~: (empty diff detected) * ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/ios-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/acd72c61d419c6ae98862b3524b30bb7) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/tvos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/2269ba9da97921a997c49946a45a06c4) (No breaking changes) * watchOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/watchos-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/9306cd30863589c1ebe0c050ea7e2ca0) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/mac-api-diff.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/d1fbaedf81824cfc04b459e01b8eb9bf) (No breaking changes)
.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/89a9b6ec94892acebb20e368e31777bc) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/96f54c677000b4a1fd4e23d43f430d6f) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/Microsoft.MacCatalyst.Ref/ref/net8.0/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/181e548a62047b7db2a8be49ff6fcaf4) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/4e5502f67b87229cc04b34ad47dc3bcf) (No breaking changes) * Microsoft.iOS vs Microsoft.MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/iOS-MacCatalyst-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/a3a93bfe0253bddb69a694dd3fa05b22)
Legacy Xamarin (stable) vs .NET * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.iOS.Ref/ref/net8.0/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/765ffc423fcbf4a1a2473ce1f6727f60) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.tvOS.Ref/ref/net8.0/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/cde1c42d77fcf1536ddeb14b98bebaaa) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20240607.5/9693755-1/;/stable-api-comparison/diff/dotnet/legacy-diff/Microsoft.macOS.Ref/ref/net8.0/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/d98d17c66e5f455e80602eb98c9fda80)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: d3cebc3f9b655b56661ae1b4c19c97278c9f11a4 [PR build]