Skip to content

Commit

Permalink
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne committed May 14, 2021
1 parent eab3acc commit ab14e07
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
10 changes: 10 additions & 0 deletions runtime/coreclr-bridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,16 @@
return rv;
}

int32_t
mono_class_value_size (MonoClass *klass, uint32_t *align)
{
int32_t rv = xamarin_bridge_sizeof (klass);

LOG_CORECLR (stderr, "%s (%p, %p) => %i\n", __func__, klass, align, rv);

return rv;
}

gboolean
mono_class_is_nullable (MonoClass * klass)
{
Expand Down
8 changes: 8 additions & 0 deletions runtime/delegates.t4
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@
OnlyCoreCLR = true,
},

new XDelegate ("int32_t", "int", "xamarin_bridge_sizeof",
"MonoObject *", "MonoObject *", "typeobj"
) {
WrappedManagedFunction = "SizeOf",
OnlyDynamicUsage = false,
OnlyCoreCLR = true,
},

new XDelegate ("MonoReferenceQueue *", "MonoObject *", "xamarin_bridge_gc_reference_queue_new",
"mono_reference_queue_callback", "IntPtr", "callback"
) {
Expand Down
4 changes: 3 additions & 1 deletion runtime/exports.t4
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
new Export ("int32_t", "mono_class_value_size",
"MonoClass *", "klass",
"uint32_t *", "align"
),
) {
HasCoreCLRBridgeFunction = true,
},

new Export ("MonoType *", "mono_class_get_type",
"MonoClass *", "klass"
Expand Down
6 changes: 6 additions & 0 deletions src/ObjCRuntime/Runtime.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@ unsafe static IntPtr ClassGetName (MonoObject *typeobj)
return (MonoObject *) GetMonoObject (type);
}

static unsafe int SizeOf (MonoObject* typeobj)
{
var type = (Type) GetMonoObjectTarget (typeobj);
return SizeOf (type);
}

static int SizeOf (Type type)
{
if (type.IsEnum) // https://github.com/dotnet/runtime/issues/12258
Expand Down

8 comments on commit ab14e07

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

Packages generated

View packages

Test results

1 tests failed, 192 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed

Pipeline on Agent XAMBOT-1024.BigSur
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Tests failed on macOS Mac Mojave (10.14) ❌

Tests failed on Mac Mojave (10.14).

Failed tests are:

  • introspection
  • xammac_tests

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Tests failed on macOS Mac High Sierra (10.13) ❌

Tests failed on Mac High Sierra (10.13).

Failed tests are:

  • introspection
  • xammac_tests

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Status for 'xamarin-macios - sample testing (build)': failure.

  • ❌ Debug_iPhone_AF: Failed
  • ❌ Debug_iPhone_GR: Failed
  • ❌ Debug_iPhone_SZ: Failed
  • ❌ Debug_iPhoneSimulator: Failed
  • ❌ Release_iPhone_AF: Failed
  • ❌ Release_iPhone_GR: Failed
  • ❌ Release_iPhone_SZ: Failed
  • ❌ Release_iPhoneSimulator: Failed
  • ❌ Debug_Mac: Failed
  • ❌ Release_Mac: Failed
  • ❌ PublishPerformanceData: Failed

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (Build). ⚠️

Results were skipped for this run Azure Devops.

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS32b). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[runtime] Implement mono_class_value_size for CoreCLR. (#11554)

Please sign in to comment.