#include <assert.h>
#include <glib.h>
+#define SGEN_BINARY_PROTOCOL
+#define MONO_INTERNAL
+
#include <mono/metadata/sgen-protocol.h>
#define SGEN_PROTOCOL_EOF 255
switch (type) {
case SGEN_PROTOCOL_COLLECTION: size = sizeof (SGenProtocolCollection); break;
case SGEN_PROTOCOL_ALLOC: size = sizeof (SGenProtocolAlloc); break;
+ case SGEN_PROTOCOL_ALLOC_PINNED: size = sizeof (SGenProtocolAlloc); break;
+ case SGEN_PROTOCOL_ALLOC_DEGRADED: size = sizeof (SGenProtocolAlloc); break;
case SGEN_PROTOCOL_COPY: size = sizeof (SGenProtocolCopy); break;
case SGEN_PROTOCOL_PIN: size = sizeof (SGenProtocolPin); break;
case SGEN_PROTOCOL_MARK: size = sizeof (SGenProtocolMark); break;
printf ("alloc obj %p vtable %p size %d\n", entry->obj, entry->vtable, entry->size);
break;
}
+ case SGEN_PROTOCOL_ALLOC_PINNED: {
+ SGenProtocolAlloc *entry = data;
+ printf ("alloc pinned obj %p vtable %p size %d\n", entry->obj, entry->vtable, entry->size);
+ break;
+ }
+ case SGEN_PROTOCOL_ALLOC_DEGRADED: {
+ SGenProtocolAlloc *entry = data;
+ printf ("alloc degraded obj %p vtable %p size %d\n", entry->obj, entry->vtable, entry->size);
+ break;
+ }
case SGEN_PROTOCOL_COPY: {
SGenProtocolCopy *entry = data;
printf ("copy from %p to %p vtable %p size %d\n", entry->from, entry->to, entry->vtable, entry->size);
case SGEN_PROTOCOL_THREAD_REGISTER:
case SGEN_PROTOCOL_THREAD_UNREGISTER:
return TRUE;
- case SGEN_PROTOCOL_ALLOC: {
+ case SGEN_PROTOCOL_ALLOC:
+ case SGEN_PROTOCOL_ALLOC_PINNED:
+ case SGEN_PROTOCOL_ALLOC_DEGRADED: {
SGenProtocolAlloc *entry = data;
return matches_interval (ptr, entry->obj, entry->size);
}
long nums [num_nums];
for (i = 0; i < num_nums; ++i)
- nums [i] = strtol (argv [i + 1], NULL, 16);
+ nums [i] = strtoul (argv [i + 1], NULL, 16);
while ((type = read_entry (stdin, &data)) != SGEN_PROTOCOL_EOF) {
gboolean match = FALSE;