X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-counters.h;h=07aeb7902e3e9e714a5977035705f6216340f103;hb=62972f9afb0a9ef302ab9a34de6cd9c6cf643351;hp=a22a3e92bf3696d2f62ecc8bb198ca96fba89551;hpb=948dbf8d4581ac17f5420cc4f7dc375e3c502576;p=mono.git diff --git a/mono/utils/mono-counters.h b/mono/utils/mono-counters.h index a22a3e92bf3..07aeb7902e3 100644 --- a/mono/utils/mono-counters.h +++ b/mono/utils/mono-counters.h @@ -2,6 +2,7 @@ #define __MONO_COUNTERS_H__ #include +#include enum { MONO_COUNTER_INT, /* 32 bit int */ @@ -11,6 +12,7 @@ enum { MONO_COUNTER_ULONG, /* 64 bit uint */ MONO_COUNTER_DOUBLE, MONO_COUNTER_STRING, /* char* */ + MONO_COUNTER_TIME_INTERVAL, /* 64 bits signed int holding usecs. */ MONO_COUNTER_TYPE_MASK = 0xf, MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */ MONO_COUNTER_SECTION_MASK = 0xffffff00, @@ -37,5 +39,20 @@ void mono_counters_register (const char* descr, int type, void *addr); */ void mono_counters_dump (int section_mask, FILE *outfile); +void mono_counters_cleanup (void); + +typedef enum { + MONO_RESOURCE_JIT_CODE, /* bytes */ + MONO_RESOURCE_METADATA, /* bytes */ + MONO_RESOURCE_GC_HEAP, /* bytes */ + MONO_RESOURCE_COUNT /* non-ABI value */ +} MonoResourceType; + +typedef void (*MonoResourceCallback) (int resource_type, uintptr_t value, int is_soft); + +int mono_runtime_resource_limit (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit); +void mono_runtime_resource_set_callback (MonoResourceCallback callback); +void mono_runtime_resource_check_limit (int resource_type, uintptr_t value); + #endif /* __MONO_COUNTERS_H__ */