#ifdef ENABLE_VERIFIER_STATS
-#define MEM_ALLOC(amt) do { allocated_memory += (amt); working_set += (amt); } while (0)
-#define MEM_FREE(amt) do { working_set -= (amt); } while (0)
+#define _MEM_ALLOC(amt) do { allocated_memory += (amt); working_set += (amt); } while (0)
+#define _MEM_FREE(amt) do { working_set -= (amt); } while (0)
static int allocated_memory;
static int working_set;
#else
-#define MEM_ALLOC(amt) do {} while (0)
-#define MEM_FREE(amt) do { } while (0)
+#define _MEM_ALLOC(amt) do {} while (0)
+#define _MEM_FREE(amt) do { } while (0)
#define finish_collect_stats()
#define init_verifier_stats()
mono_type_create_fnptr_from_mono_method (VerifyContext *ctx, MonoMethod *method)
{
MonoType *res = g_new0 (MonoType, 1);
- MEM_ALLOC (sizeof (MonoType));
+ _MEM_ALLOC (sizeof (MonoType));
//FIXME use mono_method_get_signature_full
res->data.method = mono_method_signature (method);
g_assert (new_size >= required);
tmp = g_new0 (ILStackDesc, new_size);
- MEM_ALLOC (sizeof (ILStackDesc) * new_size);
+ _MEM_ALLOC (sizeof (ILStackDesc) * new_size);
if (stack->stack) {
if (stack->size)
memcpy (tmp, stack->stack, stack->size * sizeof (ILStackDesc));
g_free (stack->stack);
- MEM_FREE (sizeof (ILStackDesc) * stack->max_size);
+ _MEM_FREE (sizeof (ILStackDesc) * stack->max_size);
}
stack->stack = tmp;
ctx.code = g_new (ILCodeDesc, ctx.header->code_size);
ctx.code_size = ctx.header->code_size;
- MEM_ALLOC (sizeof (ILCodeDesc) * ctx.header->code_size);
+ _MEM_ALLOC (sizeof (ILCodeDesc) * ctx.header->code_size);
memset(ctx.code, 0, sizeof (ILCodeDesc) * ctx.header->code_size);
ctx.num_locals = ctx.header->num_locals;
ctx.locals = g_memdup (ctx.header->locals, sizeof (MonoType*) * ctx.header->num_locals);
- MEM_ALLOC (sizeof (MonoType*) * ctx.header->num_locals);
+ _MEM_ALLOC (sizeof (MonoType*) * ctx.header->num_locals);
if (ctx.num_locals > 0 && !ctx.header->init_locals)
CODE_NOT_VERIFIABLE (&ctx, g_strdup_printf ("Method with locals variable but without init locals set"));
ctx.params = g_new (MonoType*, ctx.max_args);
- MEM_ALLOC (sizeof (MonoType*) * ctx.max_args);
+ _MEM_ALLOC (sizeof (MonoType*) * ctx.max_args);
if (ctx.signature->hasthis)
ctx.params [0] = method->klass->valuetype ? &method->klass->this_arg : &method->klass->byval_arg;