Cache size of char

BlittableValueType<char> caches the size of the type parameter. This
way, we avoid calling Marshal.SizeOf repeatedly for every keyboard
event.
This commit is contained in:
Stefanos A 2013-12-09 23:46:07 +01:00
parent 128d96994b
commit 7582decf55

View file

@ -685,7 +685,7 @@ namespace OpenTK.Platform.MacOS.Carbon
OSStatus result = API.GetEventParameter(inEvent,
EventParamName.KeyMacCharCode, EventParamType.typeChar, IntPtr.Zero,
(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(char)), IntPtr.Zero,
(uint)BlittableValueType<char>.Stride, IntPtr.Zero,
(IntPtr)codeAddr);
if (result != OSStatus.NoError)