Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Application.UI] UnmanagedCallersOnly to callbacks #2520

Closed
wants to merge 2 commits into from

Conversation

t-mustafin
Copy link

@t-mustafin t-mustafin commented Jan 12, 2021

Description of Change

Mark OnCreateNative(), OnTerminateNative(), OnPauseNative(), OnResumeNative(), OnAppControlNative() and TizenSynchronizationContext+GSourceManager.Handler callbacks with UnmanagedCallersOnly attribute to prevent of IL_STUB_ReversePInvoke() generating and jitting.

API Changes

Depends on netcoreapp5.0
UnmanagedCallersOnly attribute applies only to .net 5.0.

Upd: seems it is not need changes in capi-appfw-appication.

Old message
Need change in capi-appfw-application
Type of __on_create() should be changed to unsigned char, because bool is not blittable type and conflicts with UnmanagedCallersOnly attribute.

diff --git a/src/app_main_legacy.c b/src/app_main_legacy.c
index 32cb232..7d63542 100755
--- a/src/app_main_legacy.c
+++ b/src/app_main_legacy.c                                                                   
@@ -36,14 +36,14 @@ typedef struct {                                                          
        void *data;                                                                           
 } app_context_s;                                                                             
 
-static bool __on_create(void *data)
+static unsigned char __on_create(void *data)
 {
        app_context_s *context = data;
 
        if (context->callback->create)
                return context->callback->create(context->data);
 
-       return false;
+       return 0;
 }
 
 static void __on_terminate(void *data)

cc @alpencolt

@github-actions github-actions bot added the API9 Platform: Tizen 6.5 / TFM : tizen90 label Jan 12, 2021
@TizenAPI-Bot
Copy link
Collaborator

Build Error:

/home/runner/.dotnet/sdk/3.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(127,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0. Either target .NET Core 3.1 or lower, or use a version of the .NET SDK that supports .NET Core 5.0. [src/Tizen.Applications.UI/Tizen.Applications.UI.csproj]

@t-mustafin
Copy link
Author

Link to original discussion dotnet/runtime#44948.

Mark OnCreateNative, OnTerminateNative, OnPauseNative, OnResumeNative and OnAppControlNative callbacks with UnmanagedCallersOnly attribute to prevent of IL_STUB_ReversePInvoke JITting.

Depends on netcoreapp5.0.

Signed-off-by: Timur Mustafin <[email protected]>
Mark GSourceManager.Handler() with UnmanagedCallersOnly attribute to prevent IL_STUB_ReversePInvoke generating and JITting.
Depends on netcoreapp5.0

Signed-off-by: Timur Mustafin <[email protected]>
@TizenAPI-Bot
Copy link
Collaborator

Build Error:

/home/runner/.dotnet/sdk/3.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(127,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0. Either target .NET Core 3.1 or lower, or use a version of the .NET SDK that supports .NET Core 5.0. [src/Tizen.Applications.Common/Tizen.Applications.Common.csproj]
/home/runner/.dotnet/sdk/3.1.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(127,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0. Either target .NET Core 3.1 or lower, or use a version of the .NET SDK that supports .NET Core 5.0. [src/Tizen.Applications.UI/Tizen.Applications.UI.csproj]

@github-actions
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Mar 15, 2021
@github-actions github-actions bot closed this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API9 Platform: Tizen 6.5 / TFM : tizen90 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants