2 * sgen-simple-nursery.c: Simple always promote nursery.
4 * Copyright 2001-2003 Ximian, Inc
5 * Copyright 2003-2010 Novell, Inc.
6 * Copyright 2011 Xamarin Inc (http://www.xamarin.com)
7 * Copyright (C) 2012 Xamarin Inc
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License 2.0 as published by the Free Software Foundation;
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License 2.0 along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "metadata/profiler-private.h"
28 #include "metadata/sgen-gc.h"
29 #include "metadata/sgen-protocol.h"
30 #include "metadata/sgen-layout-stats.h"
33 alloc_for_promotion (MonoVTable *vtable, char *obj, size_t objsize, gboolean has_references)
35 return major_collector.alloc_object (vtable, objsize, has_references);
39 build_fragments_get_exclude_head (void)
45 build_fragments_release_exclude_head (void)
50 build_fragments_finish (SgenFragmentAllocator *allocator)
55 prepare_to_space (char *to_space_bitmap, size_t space_bitmap_size)
60 clear_fragments (void)
65 init_nursery (SgenFragmentAllocator *allocator, char *start, char *end)
67 sgen_fragment_allocator_add (allocator, start, end);
71 /******************************************Copy/Scan functins ************************************************/
73 #define SGEN_SIMPLE_NURSERY
75 #define SERIAL_COPY_OBJECT simple_nursery_serial_copy_object
76 #define SERIAL_COPY_OBJECT_FROM_OBJ simple_nursery_serial_copy_object_from_obj
78 #include "sgen-minor-copy-object.h"
79 #include "sgen-minor-scan-object.h"
82 sgen_simple_nursery_init (SgenMinorCollector *collector)
84 collector->is_split = FALSE;
86 collector->alloc_for_promotion = alloc_for_promotion;
88 collector->prepare_to_space = prepare_to_space;
89 collector->clear_fragments = clear_fragments;
90 collector->build_fragments_get_exclude_head = build_fragments_get_exclude_head;
91 collector->build_fragments_release_exclude_head = build_fragments_release_exclude_head;
92 collector->build_fragments_finish = build_fragments_finish;
93 collector->init_nursery = init_nursery;
95 FILL_MINOR_COLLECTOR_COPY_OBJECT (collector);
96 FILL_MINOR_COLLECTOR_SCAN_OBJECT (collector);