gboolean (*ptr_is_in_non_pinned_space) (char *ptr, char **start);
gboolean (*obj_is_from_pinned_alloc) (char *obj);
void (*report_pinned_memory_usage) (void);
- int (*get_num_major_sections) (void);
+ size_t (*get_num_major_sections) (void);
gboolean (*handle_gc_param) (const char *opt);
void (*print_gc_param_usage) (void);
gboolean (*is_worker_thread) (MonoNativeThreadId thread);
#define FOREACH_BLOCK(bl) for ((bl) = all_blocks; (bl); (bl) = (bl)->next) {
#define END_FOREACH_BLOCK }
-static int num_major_sections = 0;
+static size_t num_major_sections = 0;
/* one free block list for each block object size */
static MSBlockInfo **free_block_lists [MS_BLOCK_TYPE_MAX];
major_alloc_degraded (MonoVTable *vtable, size_t size)
{
void *obj;
- int old_num_sections;
+ size_t old_num_sections;
old_num_sections = num_major_sections;
}
/* only valid during minor collections */
-static int old_num_major_sections;
+static mword old_num_major_sections;
static void
major_start_nursery_collection (void)
return size;
}
-static int
+static size_t
get_num_major_sections (void)
{
return num_major_sections;
/* use this to tune when to do a major/minor collection */
static mword memory_pressure = 0;
static mword minor_collection_allowance;
-static int minor_collection_sections_alloced = 0;
+static mword minor_collection_sections_alloced = 0;
-static int last_major_num_sections = 0;
-static int last_los_memory_usage = 0;
+static mword last_major_num_sections = 0;
+static mword last_los_memory_usage = 0;
static gboolean need_calculate_minor_collection_allowance;
-static int last_collection_old_num_major_sections;
+static mword last_collection_old_num_major_sections;
static mword last_collection_los_memory_usage = 0;
static mword last_collection_old_los_memory_usage;
static mword last_collection_los_memory_alloced;
static void
sgen_memgov_try_calculate_minor_collection_allowance (gboolean overwrite)
{
- int num_major_sections, num_major_sections_saved;
+ size_t num_major_sections, num_major_sections_saved;
mword los_memory_saved, new_major, new_heap_size, save_target, allowance_target;
if (overwrite)
log_timming (GGTimingInfo *info)
{
//unsigned long stw_time, unsigned long bridge_time, gboolean is_overflow
- int num_major_sections = major_collector.get_num_major_sections ();
+ mword num_major_sections = major_collector.get_num_major_sections ();
char full_timing_buff [1024];
full_timing_buff [0] = '\0';
}
void
-sgen_register_major_sections_alloced (int num_sections)
+sgen_register_major_sections_alloced (size_t num_sections)
{
minor_collection_sections_alloced += num_sections;
}
g_assert (!(flags & ~SGEN_ALLOC_HEAP));
mono_vfree (addr, size);
- SGEN_ATOMIC_ADD_P (total_alloc, -size);
+ SGEN_ATOMIC_ADD_P (total_alloc, -(gssize)size);
if (flags & SGEN_ALLOC_HEAP)
MONO_GC_HEAP_FREE ((mword)addr, size);
}
void
sgen_memgov_release_space (mword size, int space)
{
- SGEN_ATOMIC_ADD_P (allocated_heap, -size);
+ SGEN_ATOMIC_ADD_P (allocated_heap, -(gssize)size);
}
gboolean