Skip to content

Conversation

@kotlarmilos
Copy link
Member

Description

This PR adds functional tests for InitWithCopy and Destroy functions in value witness table. The goal is to verify that InitWithCopy and Destroy could be used to maintain ref counting for value types at arbirary level of nesting. Additionally,

They could be used to verify refactoring effort in destructor and marshalling scenarios.

Additionally, the tests can be used to verify assumptions about the ARC mechanism and to validate future changes in destructor and marshalling scenarios.

Out-of-scope

This PR doesn't change projections.

Contributes to #2851

public delegate* unmanaged<void*, void*, TypeMetadata, void*> InitializeBufferWithCopyOfBuffer;

/// <summary>
/// void Destroy (object, witnessTable)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: update the comment as well

@@ -0,0 +1,130 @@
// // Copyright (c) Microsoft Corporation.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: double comment

@kotlarmilos kotlarmilos merged commit 0d87e78 into dotnet:feature/swift-bindings Feb 25, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-SwiftBindings Swift bindings for .NET

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants