Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Convert Timeout/Idle.Handler method from instance to static, so it's … #150

Merged
merged 1 commit into from
Aug 4, 2016

Conversation

DavidKarlas
Copy link
Member

…not JITed on every Application.Invoke

If method is instance instead of static every time it's passed as delegate to unmanaged code runtime(mono) needs to JIT it
since "this" is part of JITed method, with this change JITing doesn't need to be performed anymore

…not JITed on every Application.Invoke

If method is instance instead of static every time it's passed as delegate to unmanaged code runtime(mono) needs to JIT it
since "this" is part of JITed method, with this change JITing doesn't need to be performed anymore
@Therzok
Copy link
Contributor

Therzok commented Aug 1, 2016

LGTM.

@@ -32,7 +32,7 @@ namespace GLib {
public class Idle {

[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
delegate bool IdleHandlerInternal ();
delegate bool IdleHandlerInternal (IntPtr ptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this take an IntPtr, when the proxyId is an int?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, looks like the native counterpart takes a long.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure native counterpart is taking pointer, hence IntPtr...
In theory this should be used to store pointer to data object, but int is enough for our use case...

@DavidKarlas DavidKarlas merged commit 48d9fee into mono:gtk-sharp-2-12-branch Aug 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants