f557936e9c
Defining xm_nint_t to be 32-bit sized only on i386 is not the right thing to do for armv7. Strangely enough this caused just a single test failure: MonoTouchFixtures.Foundation.CalendarTest [FAIL] TestFindNextDateAfterDateMatching : Expected: <Foundation.MonoTouchException> But was: null at MonoTouchFixtures.Foundation.CalendarTest.TestFindNextDateAfterDateMatching() and that happened because: 1. We use a wrapper function around objc_msgSend: void * xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_exception (id self, SEL sel, void * p0, void * p1, xm_nuint_t p2, GCHandle *exception_gchandle) { @try { return ((func_xamarin_IntPtr_objc_msgSend_IntPtr_IntPtr_nuint_exception) objc_msgSend) (self, sel, p0, p1, p2); } @catch (NSException *e) { xamarin_process_nsexception_using_mode (e, true, exception_gchandle); return NULL; } } 2. Note that the second to last argument is an 'xm_nuint_t'. We told the native compiler this was a 64-bit value, when the managed P/Invoke would give it a 32-bit value. This had no effect on the 'p2' parameter, but it meant that clang would thing the next argument, 'exception_gchandle', would be somewhere it wasn't (the managed function would pass two 32-bit values, 'p2' and 'exception_gchandle', which clang would merge into a single 64-bit 'p2' argument, and then read random stuff for 'exception_gchandle'). 3. Finally things would go sideways when we caught the exception and passed 'exception_gchandle' to xamarin_process_nsexception_using_mode. In effect we'd ask xamarin_process_nsexception_using_mode to store the resulting gchandle in random memory. Amazingly it only resulted in a test failure (because upon return the managed location for the 'exception_gchandle' wasn't touched, and would have its initial value of 0, thus managed code would think no exception occurred). So fix this to use the correct underlying types, instead of trying to figure out the correct #if condition. I'm not sure why we're using our own types here anyways, but this fix is the smallest. |
||
---|---|---|
.. | ||
xamarin | ||
.gitignore | ||
COOP.md | ||
Delegates.cs.t4 | ||
EXCEPTIONS.md | ||
Makefile | ||
README.md | ||
Xamarin.framework-iphoneos.Info.plist | ||
Xamarin.framework-iphonesimulator.Info.plist | ||
Xamarin.framework-tvos.Info.plist | ||
Xamarin.framework-tvsimulator.Info.plist | ||
Xamarin.framework-watchos.Info.plist | ||
Xamarin.framework-watchsimulator.Info.plist | ||
bindings-generator.cs | ||
bindings-generator.csproj | ||
bindings.h | ||
bindings.m | ||
coreclr-bridge.m | ||
delegates.h.t4 | ||
delegates.inc.t4 | ||
delegates.t4 | ||
exports.t4 | ||
extension-main.m | ||
frameworks.h | ||
launcher.h | ||
launcher.m | ||
libmonotouch.csproj | ||
libxammac.csproj | ||
main-internal.h | ||
mono-runtime.h.t4 | ||
mono-runtime.m.t4 | ||
monotouch-debug.h | ||
monotouch-debug.m | ||
monotouch-main.m | ||
monotouch-support.h | ||
monovm-bridge.m | ||
nsstring-localization.m | ||
product.h | ||
runtime-generated.h.t4 | ||
runtime-internal.h | ||
runtime.m | ||
shared.h | ||
shared.m | ||
slinked-list.h | ||
trampolines-arm64-asm.s | ||
trampolines-arm64-objc_msgSend.inc.s | ||
trampolines-arm64-objc_msgSend.s | ||
trampolines-arm64-objc_msgSendSuper.s | ||
trampolines-arm64.h | ||
trampolines-arm64.m | ||
trampolines-i386-asm.s | ||
trampolines-i386-objc_msgSend-copyframe.inc | ||
trampolines-i386-objc_msgSend-post.inc | ||
trampolines-i386-objc_msgSend-pre.inc | ||
trampolines-i386-objc_msgSend.s | ||
trampolines-i386-objc_msgSendSuper.s | ||
trampolines-i386-objc_msgSendSuper_stret.s | ||
trampolines-i386-objc_msgSend_stret.s | ||
trampolines-i386.h | ||
trampolines-i386.m | ||
trampolines-internal.h | ||
trampolines-invoke.m | ||
trampolines-varargs.h | ||
trampolines-varargs.m | ||
trampolines-x86_64-asm.s | ||
trampolines-x86_64-objc_msgSend-copyframe.inc | ||
trampolines-x86_64-objc_msgSend-post.inc | ||
trampolines-x86_64-objc_msgSend-pre.inc | ||
trampolines-x86_64-objc_msgSend.s | ||
trampolines-x86_64-objc_msgSendSuper.s | ||
trampolines-x86_64-objc_msgSendSuper_stret.s | ||
trampolines-x86_64-objc_msgSend_stret.s | ||
trampolines-x86_64.h | ||
trampolines-x86_64.m | ||
trampolines.m | ||
xamarin-support.m |
README.md
Native runtime
This directory contains the native runtime for Xamarin.iOS and Xamarin.Mac.
Cooperative GC
See COOP.md
Generated code
A few files are generated automatically:
delegates.h|inc, Delegates.cs
These files contain the code required to glue the native runtime and the managed runtime.
mono-runtime.m, xamarin/mono-runtime.h
These files contain code that makes other code, consumers of the mono runtime, oblivious to whether the mono runtime is linked statically, dynamically, or using dlopen at runtime.
If you need to use a new function from the Mono headers, add it to exports.t4.
If you need a new enum / constant / typedef / etc, add it to mono-runtime.h.t4.
Shipped headers
These are the headers shipped with XI/XM (they're not for public consumption, but we need them to build generated code on customers machine, in particular main.m and registrar.m)
xamarin/runtime.h xamarin/trampolines.h xamarin/main.h xamarin/xamarin.h