+Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+ * reflection.c: sort methodsemantics table.
+
Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
* reflection.h, reflection.c: honour init locals setting.
(p) += 4 - (__diff & 3);\
} while (0)
+static int
+compare_semantics (const void *a, const void *b)
+{
+ const guint32 *a_values = a;
+ const guint32 *b_values = b;
+ int assoc = a_values [MONO_METHOD_SEMA_ASSOCIATION] - b_values [MONO_METHOD_SEMA_ASSOCIATION];
+ if (assoc)
+ return assoc;
+ return a_values [MONO_METHOD_SEMA_SEMANTICS] - b_values [MONO_METHOD_SEMA_SEMANTICS];
+
+
+}
+
/*
* build_compressed_metadata() fills in the blob of data that represents the
* raw metadata as it will be saved in the PE file. The five streams are output
static void
build_compressed_metadata (MonoDynamicAssembly *assembly)
{
+ MonoDynamicTable *table;
int i;
guint64 valid_mask = 0;
guint64 sorted_mask;
*int32val++ = meta->tables [i].rows;
}
p = (unsigned char*)int32val;
+
+ /* sort the tables that still need sorting */
+ table = &assembly->tables [MONO_TABLE_METHODSEMANTICS];
+ if (table->rows)
+ qsort (table->values + MONO_METHOD_SEMA_SIZE, table->rows, sizeof (guint32) * MONO_METHOD_SEMA_SIZE, compare_semantics);
+
/* compress the tables */
for (i = 0; i < 64; i++){
int row, col;