[runtime] Compile cleanly with -Wc++-compat.
[mono.git] / mono / sgen / sgen-protocol-def.h
index 9f8f9bcd6eb9e82cf87c94235d7d3732dd6e6150..6d76952b0af8a57077aa2cc475916a2209b59a62 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * All binary protocol entries are defined here.  To keep compatibility with past binary
+ * protocol files, new protocol entries need to be defined at the end of the file so that
+ * the sequential numbering is preserved.  We also can't change the types or numbers of
+ * arguments of existing entries.  Instead, a new entry has to be added and the old entry
+ * retired - add a comment to make clear it's not used anymore, but it needs to stay in the
+ * definition file, both to preserve the numbering as well as for the benefit of
+ * `sgen-grep-binprot`, which will still want to read the old entries.
+ *
+ * It might become necessary to add a header protocol entry that includes version
+ * information.  If/when we do that, we should also include word length and endianness.  As
+ * of right now, binary protocol files don't identify themselves as 32 vs 64 bits or big- vs
+ * little-endian.  At that point, `sgen-grep-binprot` should also be made able to read all
+ * combinations of files, regardless of the host.
+ */
+
 BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_requested, TYPE_INT, generation, TYPE_SIZE, requested_size, TYPE_BOOL, force)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
@@ -96,7 +112,7 @@ MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTO
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new)
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new_)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
@@ -356,6 +372,13 @@ MATCH_INDEX (ptr == entry->cursor ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCO
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_mod_union_remset, TYPE_POINTER, obj, TYPE_POINTER, ptr, TYPE_POINTER, value, TYPE_POINTER, value_vtable)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (FALSE)
+MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->ptr ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCOL_NO_MATCH)
+IS_VTABLE_MATCH (ptr == entry->value_vtable)
+END_PROTOCOL_ENTRY_HEAVY
+
 #undef BEGIN_PROTOCOL_ENTRY0
 #undef BEGIN_PROTOCOL_ENTRY1
 #undef BEGIN_PROTOCOL_ENTRY2