Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot bf159969f9
[foundation] Avoid unnecessary native calls for NSNull.Null. Fixes #3544 (#3984)
Repetitive calls to `NSNull.Null.Handle`, e.g. from `NSArray.UnsafeGetItem<T>`,
means several (one by item), costly, calls into ObjC code - but it always
return the same (native) singleton.

This manually cache the managed `NSNull.Null` static value, once it's
initialized the first time, so future calls won't have the performance
penalty.

https://github.com/xamarin/xamarin-macios/issues/3544
2018-04-26 09:24:46 -04:00
Rolf Bjarne Kvinge b4331523f6 [tests] Don't cap return value to 32-bit on 64-bit platforms in NSArrayTest.Sort. Fixes #53298. (#2149)
https://bugzilla.xamarin.com/show_bug.cgi?id=53298
2017-05-31 17:33:00 +02:00
Sebastien Pouliot 1dbffeb3f8 [foundation] Return an empty NSArray that is valid for both managed and native side (#1473)
The existing code was cheating and returned a managed only instance with a `nil` handle. That was fine in many cases but some API (e.g. UISegmentedControl) don't like that (i.e. don't react like a normal, empty NSArray was supplied). It's also the right thing to do since the current behaviour is not guaranteed to remain identical on future updates of the OS.

Unit tests updated.
2017-01-11 19:32:16 -05:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00