Skip to content

Commit 4176951

Browse files
authored
[NSObject] Store the super handle in a ConditionalWeakTable. (#25454)
Store the super handle in a ConditionalWeakTable. * Allocate native memory for it. * Cache that native memory in a ConditionalWeakTable. * Free it when the NSObject is freed (but not before). * Obsolete the SuperHandle property in .NET 11, and remove it in XAMCORE_5_0. This is less performant, but any performance issues will be alleviated by the fact that NSObject.GetSuper () will be called much less after #25376. The great advantage is that NSObjectData is now smaller, and fits in the tagged memory returned by `ObjectiveCMarshal.CreateReferenceTrackingHandle`, which will simplify memory management _a lot_ for CoreCLR. Contributes towards #25383. This is a continuation/simplification of #25405.
1 parent 79ec998 commit 4176951

25 files changed

Lines changed: 175 additions & 112 deletions

‎runtime/xamarin/runtime.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,9 @@ extern xamarin_register_assemblies_callback xamarin_register_assemblies;
367367
// This has a managed equivalent in NSObject.cs
368368
struct NSObjectData {
369369
id handle;
370-
struct objc_super* super;
371370
uint32_t /* NSObjectFlags */ flags;
372371
// if this structure ever changes, the encoding for this method will likely have to be updated in Registrar.RegistrarTypeUnsafe, currently it's:
373-
// Signature = "^{NSObjectData=@^{objc_super}I}:",
372+
// Signature = "^{NSObjectData=@I}:",
374373
};
375374

376375
#ifdef __cplusplus

‎src/Foundation/NSObject2.cs‎

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,9 @@ internal interface INSObjectFactory {
119119

120120
#if !COREBUILD
121121
// Allocated in native memory, so that it can be accessed from native code without having to deal with the GC.
122-
// Also put objc_super here, because it simplifies code.
123122
// This is mirrored in runtime.h and the definition needs to be in sync.
124123
struct NSObjectData {
125-
// the layout here is important, the two first fields have to match the objc_super struct.
126124
public NativeHandle handle;
127-
public NativeHandle classHandle;
128125
public NSObject.Flags flags;
129126
}
130127

@@ -137,34 +134,42 @@ struct NSObjectData {
137134
// * https://github.com/AustinWise/runtime/blob/2bd10ad43df967950657ae0ade1f899dc1b18a41/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.NativeAot.cs#L15
138135
// * https://github.com/AustinWise/runtime/blob/2bd10ad43df967950657ae0ade1f899dc1b18a41/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.NativeAot.cs#L59-L71
139136
// * https://github.com/AustinWise/runtime/blob/2bd10ad43df967950657ae0ade1f899dc1b18a41/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveCMarshal.NativeAot.cs#L181-L185
140-
unsafe class NSObjectDataHandle {
141-
NSObjectData* data;
137+
unsafe class NSObjectDataHandle : TrackedMemory {
138+
public NSObjectData* Data { get => (NSObjectData*) Value; }
139+
140+
public NSObjectDataHandle () : base ((nuint) sizeof (NSObjectData))
141+
{
142+
}
143+
}
144+
145+
class TrackedMemory {
142146
GCHandle handle;
143147

144-
public NSObjectData* Data { get => data; }
148+
public IntPtr Value { get; private set; }
145149

146-
public NSObjectDataHandle ()
150+
public unsafe TrackedMemory (nuint size)
147151
{
148-
data = Runtime.AllocZeroed<NSObjectData> ();
152+
Value = (IntPtr) NativeMemory.AllocZeroed (size);
149153
}
150154

151-
public void CreateHandle (NSObject obj)
155+
public unsafe void CreateHandle (NSObject trackedObject)
152156
{
153-
handle = GCHandle.Alloc (obj, GCHandleType.WeakTrackResurrection);
157+
handle = GCHandle.Alloc (trackedObject, GCHandleType.WeakTrackResurrection);
154158
}
155159

156-
~NSObjectDataHandle ()
160+
~TrackedMemory ()
157161
{
158162
var handleAllocated = handle.IsAllocated;
159-
160163
if (handleAllocated && handle.Target is not null) {
161164
// The NSObject instance isn't gone yet, we have to try again later.
162165
GC.ReRegisterForFinalize (this);
163166
return;
164167
}
165168

166-
NativeMemory.Free (data);
167-
data = null;
169+
unsafe {
170+
NativeMemory.Free ((void*) Value);
171+
}
172+
Value = IntPtr.Zero;
168173

169174
if (handleAllocated)
170175
handle.Free ();
@@ -208,6 +213,10 @@ public partial class NSObject : INativeObject
208213
// having to attach those threads to to the managed runtime.
209214
IntPtr /* unsafe NSObjectData* */ __data; // Read directly from several places in the runtime
210215

216+
#pragma warning disable CS8618 // "Non-nullable field '...' must contain a non-null value when exiting constructor.": this field is always non-null, because NSObject.Initialize is called before anything else is done.
217+
static ConditionalWeakTable<NSObject, TrackedMemory> super_map;
218+
#pragma warning restore CS8618
219+
211220
unsafe NativeHandle handle {
212221
get => GetData ()->handle;
213222
set => GetData ()->handle = value;
@@ -388,17 +397,28 @@ internal static IntPtr CreateNSObject (IntPtr type_gchandle, IntPtr handle, Flag
388397
}
389398
}
390399

400+
#if !XAMCORE_5_0
391401
unsafe NativeHandle GetSuper ()
392402
{
393-
var data = GetData ();
394-
if (data->classHandle == NativeHandle.Zero)
395-
data->classHandle = ClassHandle;
396-
return (IntPtr) (&data->handle);
403+
var memory = super_map.GetValue (this, (obj) => {
404+
unsafe {
405+
var memory = new TrackedMemory ((nuint) sizeof (objc_super));
406+
memory.CreateHandle (obj);
407+
return memory;
408+
}
409+
});
410+
objc_super* sup = (objc_super*) memory.Value;
411+
if (sup->ClassHandle == NativeHandle.Zero)
412+
sup->ClassHandle = ClassHandle;
413+
sup->Handle = handle;
414+
return memory.Value;
397415
}
416+
#endif // !XAMCORE_5_0
398417

399418
internal static NativeHandle Initialize ()
400419
{
401420
data_table = new ConditionalWeakTable<NSObject, NSObjectDataHandle> ();
421+
super_map = new ConditionalWeakTable<NSObject, TrackedMemory> ();
402422
return class_ptr;
403423
}
404424

@@ -722,16 +742,35 @@ public NSObject DangerousAutorelease ()
722742
return this;
723743
}
724744

745+
#if !XAMCORE_5_0
725746
/// <summary>Handle used to represent the methods in the base class for this <see cref="NSObject" />.</summary>
726747
/// <value>An opaque pointer, represents an Objective-C objc_super object pointing to our base class.</value>
727748
/// <remarks>
728-
/// This property is used to access members of a base class.
729-
/// This is typically used when you call any of the Messaging
730-
/// methods to invoke methods that were implemented in your base
731-
/// class, instead of invoking the implementation in the current
732-
/// class.
749+
/// <para>
750+
/// This property is used to access members of a base class.
751+
/// This is typically used when you call any of the Messaging
752+
/// methods to invoke methods that were implemented in your base
753+
/// class, instead of invoking the implementation in the current
754+
/// class.
755+
/// </para>
756+
/// <para>
757+
/// This property is obsolete; use the <see cref="ObjCSuper" /> struct instead:
758+
/// </para>
759+
/// <example>
760+
/// <code lang="csharp lang-csharp"><![CDATA[
761+
/// [DllImport ("/usr/lib/libobjc.dylib")]
762+
/// unsafe static extern void objc_msgSendSuper (ObjCSuper* super, IntPtr sel);
763+
///
764+
/// var obj = new MyNSObject ();
765+
/// var super = new ObjCSuper (obj);
766+
/// objc_msgSendSuper (&super, Selector.GetHandle ("description"));
767+
/// ]]></code>
768+
/// </example>
733769
/// </remarks>
734770
[EditorBrowsable (EditorBrowsableState.Never)]
771+
#if NET11_0_OR_GREATER
772+
[Obsolete ("Use 'ObjCSuper' instead.")]
773+
#endif
735774
public NativeHandle SuperHandle {
736775
get {
737776
if (handle == IntPtr.Zero)
@@ -740,6 +779,7 @@ public NativeHandle SuperHandle {
740779
return GetSuper ();
741780
}
742781
}
782+
#endif // !XAMCORE_5_0
743783

744784
/// <summary>Handle (pointer) to the unmanaged object representation.</summary>
745785
/// <value>A pointer.</value>

‎src/ObjCRuntime/Registrar.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ void FlattenInterfaces (TType? [] ifaces)
21252125
objcType.Add (new ObjCMethod (this, objcType, null) {
21262126
Selector = "xamarinGetNSObjectData",
21272127
Trampoline = Trampoline.GetNSObjectData,
2128-
Signature = "^{NSObjectData=@^{objc_super}I}:",
2128+
Signature = "^{NSObjectData=@I}:",
21292129
IsStatic = false,
21302130
}, ref exceptions);
21312131
}

‎tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,9 @@ Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NS
195195
Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NSObject/XamarinGCHandleFlags::InitialSet
196196
Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NSObject/XamarinGCHandleFlags::None
197197
Microsoft.MacCatalyst.dll:Foundation.NSObjectData
198-
Microsoft.MacCatalyst.dll:Foundation.NSObjectData* Foundation.NSObjectDataHandle::data
199198
Microsoft.MacCatalyst.dll:Foundation.NSObjectData* Foundation.NSObjectDataHandle::Data()
200199
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle
201200
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle..ctor()
202-
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.CreateHandle(Foundation.NSObject)
203-
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.Finalize()
204201
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.get_Data()
205202
Microsoft.MacCatalyst.dll:Foundation.NSObjectFlag
206203
Microsoft.MacCatalyst.dll:Foundation.NSObjectFlag Foundation.NSObjectFlag::Empty
@@ -252,6 +249,12 @@ Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute.get_IsStubClass()
252249
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute.get_IsWrapper()
253250
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute.get_Name()
254251
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute.get_SkipRegistration()
252+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory
253+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory..ctor(System.UIntPtr)
254+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.CreateHandle(Foundation.NSObject)
255+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.Finalize()
256+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.get_Value()
257+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.set_Value(System.IntPtr)
255258
Microsoft.MacCatalyst.dll:Foundation.You_Should_Not_Call_base_In_This_Method
256259
Microsoft.MacCatalyst.dll:Foundation.You_Should_Not_Call_base_In_This_Method..ctor()
257260
Microsoft.MacCatalyst.dll:ObjCRuntime.__Registrar__
@@ -495,7 +498,6 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::class_pt
495498
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::ClassHandle()
496499
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::handle()
497500
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::Handle()
498-
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObjectData::classHandle
499501
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObjectData::handle
500502
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSString::class_ptr
501503
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSString::ClassHandle()
@@ -592,7 +594,6 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.<ConstructINativeObject>g__Constru
592594
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.<ConstructNSObject>g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
593595
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
594596
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
595-
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocZeroed`1()
596597
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
597598
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, System.IntPtr*)
598599
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
@@ -1334,6 +1335,8 @@ Microsoft.MacCatalyst.dll:System.IntPtr CoreFoundation.CFRange::len
13341335
Microsoft.MacCatalyst.dll:System.IntPtr CoreFoundation.CFRange::loc
13351336
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.NSObject::__data
13361337
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.NSObject/NSObject_Disposer::class_ptr
1338+
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.TrackedMemory::<Value>k__BackingField
1339+
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.TrackedMemory::Value()
13371340
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.AdoptsAttribute::ProtocolHandle()
13381341
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.BlockCollector::block
13391342
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.Libraries/CoreFoundation::Handle
@@ -1497,9 +1500,10 @@ Microsoft.MacCatalyst.dll:System.Reflection.MethodBase Registrar.Registrar/ObjCM
14971500
Microsoft.MacCatalyst.dll:System.Reflection.PropertyInfo Registrar.Registrar/ObjCProperty::Property
14981501
Microsoft.MacCatalyst.dll:System.Reflection.TypeFilter Registrar.SharedDynamic/<>c::<>9__0_0
14991502
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<Foundation.NSObject,Foundation.NSObjectDataHandle> Foundation.NSObject::data_table
1503+
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<Foundation.NSObject,Foundation.TrackedMemory> Foundation.NSObject::super_map
15001504
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Delegate,ObjCRuntime.BlockCollector> ObjCRuntime.Runtime::block_lifetime_table
15011505
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Reflection.Assembly,System.String> ObjCRuntime.Class::assembly_to_name
1502-
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.GCHandle Foundation.NSObjectDataHandle::handle
1506+
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.GCHandle Foundation.TrackedMemory::handle
15031507
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::height
15041508
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::width
15051509
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::x

‎tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
AppBundleSize: 5,787,160 bytes (5,651.5 KB = 5.5 MB)
1+
AppBundleSize: 5,789,578 bytes (5,653.9 KB = 5.5 MB)
22
# The following list of files and their sizes is just informational / for review, and isn't used in the test:
33
Contents/_CodeSignature/CodeResources: 3,310 bytes (3.2 KB = 0.0 MB)
4-
Contents/Info.plist: 1,101 bytes (1.1 KB = 0.0 MB)
5-
Contents/MacOS/SizeTestApp: 4,563,536 bytes (4,456.6 KB = 4.4 MB)
6-
Contents/MonoBundle/Microsoft.MacCatalyst.dll: 157,184 bytes (153.5 KB = 0.1 MB)
4+
Contents/Info.plist: 1,119 bytes (1.1 KB = 0.0 MB)
5+
Contents/MacOS/SizeTestApp: 4,565,424 bytes (4,458.4 KB = 4.4 MB)
6+
Contents/MonoBundle/Microsoft.MacCatalyst.dll: 157,696 bytes (154.0 KB = 0.2 MB)
77
Contents/MonoBundle/runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB)
88
Contents/MonoBundle/SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB)
99
Contents/MonoBundle/System.Private.CoreLib.aotdata.arm64: 41,224 bytes (40.3 KB = 0.0 MB)

‎tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,9 @@ Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NS
178178
Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NSObject/XamarinGCHandleFlags::InitialSet
179179
Microsoft.MacCatalyst.dll:Foundation.NSObject/XamarinGCHandleFlags Foundation.NSObject/XamarinGCHandleFlags::None
180180
Microsoft.MacCatalyst.dll:Foundation.NSObjectData
181-
Microsoft.MacCatalyst.dll:Foundation.NSObjectData* Foundation.NSObjectDataHandle::data
182181
Microsoft.MacCatalyst.dll:Foundation.NSObjectData* Foundation.NSObjectDataHandle::Data()
183182
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle
184183
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle..ctor()
185-
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.CreateHandle(Foundation.NSObject)
186-
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.Finalize()
187184
Microsoft.MacCatalyst.dll:Foundation.NSObjectDataHandle.get_Data()
188185
Microsoft.MacCatalyst.dll:Foundation.NSObjectFlag
189186
Microsoft.MacCatalyst.dll:Foundation.NSObjectFlag Foundation.NSObjectFlag::Empty
@@ -194,6 +191,12 @@ Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute
194191
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute..ctor(System.String, System.Boolean)
195192
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute..ctor(System.String)
196193
Microsoft.MacCatalyst.dll:Foundation.RegisterAttribute.get_IsWrapper()
194+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory
195+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory..ctor(System.UIntPtr)
196+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.CreateHandle(Foundation.NSObject)
197+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.Finalize()
198+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.get_Value()
199+
Microsoft.MacCatalyst.dll:Foundation.TrackedMemory.set_Value(System.IntPtr)
197200
Microsoft.MacCatalyst.dll:Foundation.You_Should_Not_Call_base_In_This_Method
198201
Microsoft.MacCatalyst.dll:Foundation.You_Should_Not_Call_base_In_This_Method..ctor()
199202
Microsoft.MacCatalyst.dll:ObjCRuntime.__Registrar__
@@ -375,7 +378,6 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::class_pt
375378
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::ClassHandle()
376379
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::handle()
377380
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObject::Handle()
378-
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObjectData::classHandle
379381
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle Foundation.NSObjectData::handle
380382
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle ObjCRuntime.Class::handle
381383
Microsoft.MacCatalyst.dll:ObjCRuntime.NativeHandle ObjCRuntime.Class::Handle()
@@ -450,7 +452,6 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.<ConstructINativeObject>g__Constru
450452
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.<ConstructNSObject>g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
451453
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
452454
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
453-
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocZeroed`1()
454455
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
455456
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, System.IntPtr*)
456457
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
@@ -721,6 +722,8 @@ Microsoft.MacCatalyst.dll:System.IntPtr CoreFoundation.CFRange::len
721722
Microsoft.MacCatalyst.dll:System.IntPtr CoreFoundation.CFRange::loc
722723
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.NSObject::__data
723724
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.NSObject/NSObject_Disposer::class_ptr
725+
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.TrackedMemory::<Value>k__BackingField
726+
Microsoft.MacCatalyst.dll:System.IntPtr Foundation.TrackedMemory::Value()
724727
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.BlockCollector::block
725728
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.Libraries/CoreFoundation::Handle
726729
Microsoft.MacCatalyst.dll:System.IntPtr ObjCRuntime.NativeHandle::handle
@@ -852,9 +855,10 @@ Microsoft.MacCatalyst.dll:System.Object ObjCRuntime.Class::verification_lock
852855
Microsoft.MacCatalyst.dll:System.Object ObjCRuntime.Runtime::lock_obj
853856
Microsoft.MacCatalyst.dll:System.Reflection.Assembly Foundation.NSObject::PlatformAssembly
854857
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<Foundation.NSObject,Foundation.NSObjectDataHandle> Foundation.NSObject::data_table
858+
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<Foundation.NSObject,Foundation.TrackedMemory> Foundation.NSObject::super_map
855859
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Delegate,ObjCRuntime.BlockCollector> ObjCRuntime.Runtime::block_lifetime_table
856860
Microsoft.MacCatalyst.dll:System.Runtime.CompilerServices.ConditionalWeakTable`2<System.Reflection.Assembly,System.String> ObjCRuntime.Class::assembly_to_name
857-
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.GCHandle Foundation.NSObjectDataHandle::handle
861+
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.GCHandle Foundation.TrackedMemory::handle
858862
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::height
859863
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::width
860864
Microsoft.MacCatalyst.dll:System.Runtime.InteropServices.NFloat CoreGraphics.CGRect::x

‎tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
AppBundleSize: 16,323,580 bytes (15,941.0 KB = 15.6 MB)
1+
AppBundleSize: 16,325,774 bytes (15,943.1 KB = 15.6 MB)
22
# The following list of files and their sizes is just informational / for review, and isn't used in the test:
33
Contents/_CodeSignature/CodeResources: 4,134 bytes (4.0 KB = 0.0 MB)
4-
Contents/Info.plist: 1,101 bytes (1.1 KB = 0.0 MB)
5-
Contents/MacOS/SizeTestApp: 13,812,384 bytes (13,488.7 KB = 13.2 MB)
4+
Contents/Info.plist: 1,119 bytes (1.1 KB = 0.0 MB)
5+
Contents/MacOS/SizeTestApp: 13,814,640 bytes (13,490.9 KB = 13.2 MB)
66
Contents/MonoBundle/aot-instances.aotdata.arm64: 1,045,032 bytes (1,020.5 KB = 1.0 MB)
7-
Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 36,368 bytes (35.5 KB = 0.0 MB)
7+
Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 36,288 bytes (35.4 KB = 0.0 MB)
88
Contents/MonoBundle/Microsoft.MacCatalyst.dll: 50,688 bytes (49.5 KB = 0.0 MB)
99
Contents/MonoBundle/runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB)
1010
Contents/MonoBundle/SizeTestApp.aotdata.arm64: 1,552 bytes (1.5 KB = 0.0 MB)

0 commit comments

Comments
 (0)