const char *overflow_reason = NULL;
MONO_GC_REQUESTED (generation_to_collect, requested_size, wait_to_finish ? 1 : 0);
+ if (wait_to_finish)
+ binary_protocol_collection_force (generation_to_collect);
g_assert (generation_to_collect == GENERATION_NURSERY || generation_to_collect == GENERATION_OLD);
} while (InterlockedCompareExchange (&binary_protocol_use_count, old_count - 1, old_count) != old_count);
}
+void
+binary_protocol_collection_force (int generation)
+{
+ SGenProtocolCollectionForce entry = { generation };
+ binary_protocol_flush_buffers (FALSE);
+ protocol_entry (SGEN_PROTOCOL_COLLECTION_FORCE, &entry, sizeof (SGenProtocolCollectionForce));
+}
+
void
binary_protocol_collection_begin (int index, int generation)
{
#ifdef SGEN_BINARY_PROTOCOL
enum {
+ SGEN_PROTOCOL_COLLECTION_FORCE,
SGEN_PROTOCOL_COLLECTION_BEGIN,
SGEN_PROTOCOL_COLLECTION_END,
SGEN_PROTOCOL_ALLOC,
SGEN_PROTOCOL_DISLINK_UPDATE
};
+typedef struct {
+ int generation;
+} SGenProtocolCollectionForce;
+
typedef struct {
int index, generation;
} SGenProtocolCollection;
void binary_protocol_flush_buffers (gboolean force) MONO_INTERNAL;
+void binary_protocol_collection_force (int generation) MONO_INTERNAL;
void binary_protocol_collection_begin (int index, int generation) MONO_INTERNAL;
void binary_protocol_collection_end (int index, int generation) MONO_INTERNAL;
void binary_protocol_alloc (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
#define binary_protocol_is_enabled() FALSE
#define binary_protocol_flush_buffers(force)
+#define binary_protocol_collection_force(generation)
#define binary_protocol_collection_begin(index, generation)
#define binary_protocol_collection_end(index, generation)
#define binary_protocol_alloc(obj, vtable, size)
if (fread (&type, 1, 1, in) != 1)
return SGEN_PROTOCOL_EOF;
switch (type) {
+ case SGEN_PROTOCOL_COLLECTION_FORCE: size = sizeof (SGenProtocolCollectionForce); break;
case SGEN_PROTOCOL_COLLECTION_BEGIN: size = sizeof (SGenProtocolCollection); break;
case SGEN_PROTOCOL_COLLECTION_END: size = sizeof (SGenProtocolCollection); break;
case SGEN_PROTOCOL_ALLOC: size = sizeof (SGenProtocolAlloc); break;
print_entry (int type, void *data)
{
switch (type) {
+ case SGEN_PROTOCOL_COLLECTION_FORCE: {
+ SGenProtocolCollectionForce *entry = data;
+ printf ("collection force generation %d\n", entry->generation);
+ break;
+ }
case SGEN_PROTOCOL_COLLECTION_BEGIN: {
SGenProtocolCollection *entry = data;
printf ("collection begin %d generation %d\n", entry->index, entry->generation);
is_match (gpointer ptr, int type, void *data)
{
switch (type) {
+ case SGEN_PROTOCOL_COLLECTION_FORCE:
case SGEN_PROTOCOL_COLLECTION_BEGIN:
case SGEN_PROTOCOL_COLLECTION_END:
case SGEN_PROTOCOL_THREAD_SUSPEND: