#include "mono-codeman.h"
#include "mono-mmap.h"
+#include "mono-counters.h"
#include "dlmalloc.h"
#include <mono/metadata/class-internals.h>
#include <mono/metadata/profiler-private.h>
#include <nacl/nacl_dyncode.h>
#endif
+static uintptr_t code_memory_used = 0;
+
/*
* AMD64 processors maintain icache coherency only for pages which are
* marked executable. Also, windows DEP requires us to obtain executable memory from
} else if (dead->flags == CODE_FLAG_MALLOC) {
dlfree (dead->data);
}
+ code_memory_used -= dead->size;
free (dead);
}
}
chunk->bsize = bsize;
mono_profiler_code_chunk_new((gpointer) chunk->data, chunk->size);
+ code_memory_used += chunk_size;
+ mono_runtime_resource_check_limit (MONO_RESOURCE_JIT_CODE, code_memory_used);
/*printf ("code chunk at: %p\n", ptr);*/
return chunk;
}