#include <mono/utils/mono-counters.h>
#include "mini.h"
+
+#define ALLOW_PARTIAL_SHARING TRUE
+//#define ALLOW_PARTIAL_SHARING FALSE
#if 0
#define DEBUG(...) __VA_ARGS__
static int num_oti_allocted;
static int num_oti_bytes;
+static gboolean partial_supported = TRUE;
+
static inline gboolean
partial_sharing_supported (void)
{
- return TRUE;
+ if (!ALLOW_PARTIAL_SHARING)
+ return FALSE;
+ /* Enable this when AOT compiling or running in full-aot mode */
+ if (mono_aot_only)
+ return TRUE;
+ if (partial_supported)
+ return TRUE;
+ return FALSE;
}
static int
gsharedvt_supported = supported;
}
+void
+mono_set_partial_sharing_supported (gboolean supported)
+{
+ partial_supported = supported;
+}
+
/*
* mono_class_generic_sharing_enabled:
* @class: a class
else if (!strcmp (arg, "debug-domain-unload"))
mono_enable_debug_domain_unload (TRUE);
else if (!strcmp (arg, "partial-sharing"))
- ;
+ mono_set_partial_sharing_supported (TRUE);
else if (!strcmp (arg, "align-small-structs"))
mono_align_small_structs = TRUE;
else if (!strcmp (arg, "native-debugger-break"))
void
mono_set_generic_sharing_vt_supported (gboolean supported);
+void
+mono_set_partial_sharing_supported (gboolean supported);
+
gboolean
mono_class_generic_sharing_enabled (MonoClass *klass);