X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fsgen%2Fsgen-gc.h;h=f3d868a541648015aba3ef73d8a88f8345a30390;hb=ef0ddf45c3081e799edcb4e95770186514b80cf1;hp=afd5ba5dce858c2721c9a7e53d6113d2205b9c83;hpb=849623f0aeca7c07dfcc3d5070b8d555515be988;p=mono.git diff --git a/mono/sgen/sgen-gc.h b/mono/sgen/sgen-gc.h index afd5ba5dce8..f3d868a5416 100644 --- a/mono/sgen/sgen-gc.h +++ b/mono/sgen/sgen-gc.h @@ -6,18 +6,7 @@ * Copyright 2011 Xamarin Inc (http://www.xamarin.com) * Copyright (C) 2012 Xamarin Inc * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License 2.0 as published by the Free Software Foundation; - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License 2.0 along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #ifndef __MONO_SGENGC_H__ #define __MONO_SGENGC_H__ @@ -407,12 +396,14 @@ gboolean sgen_is_worker_thread (MonoNativeThreadId thread); typedef void (*CopyOrMarkObjectFunc) (GCObject**, SgenGrayQueue*); typedef void (*ScanObjectFunc) (GCObject *obj, SgenDescriptor desc, SgenGrayQueue*); typedef void (*ScanVTypeFunc) (GCObject *full_object, char *start, SgenDescriptor desc, SgenGrayQueue* BINARY_PROTOCOL_ARG (size_t size)); +typedef void (*ScanPtrFieldFunc) (GCObject *obj, GCObject **ptr, SgenGrayQueue* queue); typedef gboolean (*DrainGrayStackFunc) (SgenGrayQueue *queue); typedef struct { CopyOrMarkObjectFunc copy_or_mark_object; ScanObjectFunc scan_object; ScanVTypeFunc scan_vtype; + ScanPtrFieldFunc scan_ptr_field; /* Drain stack optimized for the above functions */ DrainGrayStackFunc drain_gray_stack; /*FIXME add allocation function? */ @@ -595,6 +586,12 @@ typedef struct size_t num_unique_scanned_objects; } ScannedObjectCounts; +typedef enum { + CARDTABLE_SCAN_GLOBAL = 0, + CARDTABLE_SCAN_MOD_UNION = 1, + CARDTABLE_SCAN_MOD_UNION_PRECLEAN = CARDTABLE_SCAN_MOD_UNION | 2, +} CardTableScanType; + typedef struct _SgenMajorCollector SgenMajorCollector; struct _SgenMajorCollector { size_t section_size; @@ -624,7 +621,7 @@ struct _SgenMajorCollector { void (*free_non_pinned_object) (GCObject *obj, size_t size); void (*pin_objects) (SgenGrayQueue *queue); void (*pin_major_object) (GCObject *obj, SgenGrayQueue *queue); - void (*scan_card_table) (gboolean mod_union, ScanCopyContext ctx); + void (*scan_card_table) (CardTableScanType scan_type, ScanCopyContext ctx); void (*iterate_live_block_ranges) (sgen_cardtable_block_callback callback); void (*update_cardtable_mod_union) (void); void (*init_to_space) (void); @@ -802,7 +799,7 @@ enum { void sgen_pin_object (GCObject *object, SgenGrayQueue *queue); void sgen_set_pinned_from_failed_allocation (mword objsize); -void sgen_ensure_free_space (size_t size); +void sgen_ensure_free_space (size_t size, int generation); void sgen_gc_collect (int generation); void sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish); @@ -850,7 +847,7 @@ void sgen_los_sweep (void); gboolean sgen_ptr_is_in_los (char *ptr, char **start); void sgen_los_iterate_objects (IterateObjectCallbackFunc cb, void *user_data); void sgen_los_iterate_live_block_ranges (sgen_cardtable_block_callback callback); -void sgen_los_scan_card_table (gboolean mod_union, ScanCopyContext ctx); +void sgen_los_scan_card_table (CardTableScanType scan_type, ScanCopyContext ctx); void sgen_los_update_cardtable_mod_union (void); void sgen_los_count_cards (long long *num_total_cards, long long *num_marked_cards); gboolean sgen_los_is_valid_object (char *object);