Skip to content

Commit 320954f

Browse files
authored
Merge pull request #770 from Unity-Technologies/unity-master-staging
Mono Bleeding Edge fixes for Trunk case 947208 - partial fix case 973494 - Expose mono_object_is_alive Lots of IL2CPP debugger work.
2 parents c4e698c + 9dfe4d8 commit 320954f

File tree

13 files changed

+947
-1238
lines changed

13 files changed

+947
-1238
lines changed

.editorconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# see http://editorconfig.org/ for docs on this file
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
trim_trailing_whitespace = false
8+
insert_final_newline = false
9+
indent_style = tab
10+
indent_size = 4
11+
12+
# this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
13+
# the settings are meant to closely match what VS does to minimize unnecessary diffs. this duplicates some settings in *
14+
# but let's be explicit here to be safe (in case someone wants to copy-paste this out to another .editorconfig).
15+
[*.{vcxproj,vcxproj.filters,csproj,props,targets}]
16+
indent_style = space
17+
indent_size = 2
18+
end_of_line = crlf
19+
charset = utf-8-bom
20+
trim_trailing_whitespace = true
21+
insert_final_newline = false
22+
[*.{sln,sln.template}]
23+
indent_style = tab
24+
indent_size = 4
25+
end_of_line = crlf
26+
charset = utf-8
27+
trim_trailing_whitespace = true
28+
insert_final_newline = false

mcs/class/System/ReferenceSources/SecureStringHelper.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,18 @@ internal static string CreateString(SecureString secureString)
1414

1515
if (secureString == null || secureString.Length == 0)
1616
return String.Empty;
17-
17+
#if MONO
18+
try
19+
{
20+
bstr = Marshal.SecureStringToGlobalAllocUnicode(secureString);
21+
plainString = Marshal.PtrToStringUni(bstr);
22+
}
23+
finally
24+
{
25+
if (bstr != IntPtr.Zero)
26+
Marshal.ZeroFreeGlobalAllocUnicode(bstr);
27+
}
28+
#else
1829
try
1930
{
2031
bstr = Marshal.SecureStringToBSTR(secureString);
@@ -25,6 +36,7 @@ internal static string CreateString(SecureString secureString)
2536
if (bstr != IntPtr.Zero)
2637
Marshal.ZeroFreeBSTR(bstr);
2738
}
39+
#endif
2840
return plainString;
2941
}
3042

mono/metadata/gc-internals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern void mono_gc_set_stack_end (void *stack_end);
9090
/* only valid after the RECLAIM_START GC event and before RECLAIM_END
9191
* Not exported in public headers, but can be linked to (unsupported).
9292
*/
93-
gboolean mono_object_is_alive (MonoObject* obj);
93+
MONO_API gboolean mono_object_is_alive (MonoObject* obj);
9494
gboolean mono_gc_is_finalizer_thread (MonoThread *thread);
9595

9696
void mono_gchandle_set_target (guint32 gchandle, MonoObject *obj);

mono/metadata/unity-utils.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,6 @@ mono_unity_alloc(gsize size)
11291129
MONO_API void
11301130
mono_unity_thread_fast_attach (MonoDomain *domain)
11311131
{
1132-
g_assert_not_reached ();
1133-
#if 1
11341132
MonoInternalThread *thread;
11351133

11361134
g_assert (domain);
@@ -1143,14 +1141,11 @@ mono_unity_thread_fast_attach (MonoDomain *domain)
11431141
g_assert (mono_domain_set (domain, FALSE));
11441142

11451143
//mono_profiler_thread_fast_attach (thread->tid);
1146-
#endif
11471144
}
11481145

11491146
MONO_API void
11501147
mono_unity_thread_fast_detach ()
11511148
{
1152-
g_assert_not_reached ();
1153-
#if 1
11541149
MonoInternalThread *thread;
11551150
MonoDomain *current_domain;
11561151

@@ -1168,7 +1163,6 @@ mono_unity_thread_fast_detach ()
11681163
// the thread to stay alive and keep running while the domain can be unloaded
11691164
g_assert (mono_domain_set (mono_get_root_domain (), FALSE));
11701165
mono_thread_pop_appdomain_ref ();
1171-
#endif
11721166
}
11731167

11741168
// hack, FIXME jon

0 commit comments

Comments
 (0)